【发布时间】:2011-12-05 10:57:02
【问题描述】:
以 iOS 5.0 为目标,当我尝试在以下代码中访问 NSIndexPath 对象的行或部分属性时,我看到了 SIGABRT:
NSIndexPath* path = [[NSIndexPath alloc] initWithIndex:0];
int row = path.row; //SIGABRT
int section = path.section;//SIGABRT
此示例建议使用 indexPathWithIndex: 代替 http://developer.apple.com/library/mac/#samplecode/SourceView/Listings/BaseNode_m.html#//apple_ref/doc/uid/DTS10004441-BaseNode_m-DontLinkElementID_6
path = [NSIndexPath indexPathWithIndex:0];
结果保持一致。有没有人解释为什么会发生这种情况?是不是我们在 iOS 5.0 中不能对 NSIndexPath 进行操作?
提前致谢。
【问题讨论】:
标签: ios nsindexpath