我的问题是:如何以编程方式设置NSIndexPath。以编程方式设置NSIndexPath
比如我添加方法:
- (void)setDefaultValue{
tempIndexPath = [NSIndexPath indexPathForRow:0 inSection:1];
}
在的tableView委托-cellForRowAtIndexPath我想比较两个indexPath
如果([indexPath isEqual:方法tempIndexPath])...
但在这种情况下,我tempIndexPath =空(我认为 - 因为这是autorelease对象)
如何在这种情况下设置NSIndexPath?
谢谢,所有!
创建一个属性只是为了保留一个对象我认为这是对问题的高估。除此之外,还有(外部)使成员可以从课外访问的效果,这可能是不受欢迎的,特别是考虑到我们正在谈论“临时”成员...... – Saphrosit 2012-03-22 13:33:24
@Saphrosit,您是对的。回答编辑 – LuisEspinoza 2012-03-22 13:37:13