我的问题是:如何以编程方式设置NSIndexPath。
例如,我添加了一个方法:
- (void)setDefaultValue{
tempIndexPath = [NSIndexPath indexPathForRow:0 inSection:1];
}
在tableView代理-cellForRowAtIndexPath中,我想比较两个indexPath。if([indexPath isEqual:tempIndexPath]) ...但是在这种情况下,我的tempIndexPath = null(我认为是因为这是自动释放对象)。如何在这种情况下设置NSIndexPath?谢谢大家!