关于NSIndexPath的属性修饰关的键字问题:
(1)用strong修饰
@property (nonatomic, strong) NSIndexPath *selIndex;
(2)用assign修饰
@property (nonatomic, assign) NSIndexPath *selIndex;
以上第二种写法会在ios8.0上崩溃,在ios9.0以上机型正常
NSIndexPath是继承NSObject的,是模型对象,要用strong来修饰,至于在ios8.0以上没有崩溃,应该是8.0以上做了适配。
网友评论