首页 > 其他 > 详细

Adopting Modern Objective-C

时间:2017-02-22 13:06:01      阅读:115      评论:0      收藏:0      [点我收藏+]
  • Change id to instancetype in appropriate places

  • Change enum to NS_ENUM or NS_OPTIONS

    • The NS_ENUM macro helps define both the name and type of the enumeration, in this case named UITableViewCellStyle of type NSInteger. The type for enumerations should be NSInteger.
  • Update to the @property syntax

  • Converting to literals, so a statement like [NSNumber numberWithInt:3] becomes @3.

  • Using subscripting, so a statement like [dictionary setObject:@3 forKey:key] becomes dictionary[key] = @3.

Adopting Modern Objective-C

原文:http://www.cnblogs.com/littlepony/p/6427974.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!