相关疑难解决方法(0)

indexPathForCell从ios7开始返回nil

我的应用程序在ios6.1下正常运行.尝试了ios7模拟器,以下部分不起作用:

EditingCell *cell = (EditingCell*) [[textField superview] superview];
NSIndexPath *indexPath = [self.tableView indexPathForCell:cell];
NSLog(@"the section is %d and row is %d", indexPath.section, indexPath.row);
NSUInteger section = [indexPath section];
NSUInteger row = [indexPath row];
NSString *rowKey = [[keysForRows objectAtIndex: section] objectAtIndex: row];
Run Code Online (Sandbox Code Playgroud)

总是来:

the section is 0 and row is 0
Run Code Online (Sandbox Code Playgroud)

虽然选择了另一个部分/行.有人知道为什么这在ios7下不起作用?

objective-c uitableview ios ios7

18
推荐指数
2
解决办法
1万
查看次数

indexPathForCell在IOS 7下返回NULL,在IOS 6下工作正常

我希望现在苹果公司能够接受IOS 7的应用,我们可以谈谈它吗?

我正在尝试修复我的应用程序,因此它适用于IOS 7并且今晚取得了一些非常好的进展.我有两个悬而未决的问题,但会分别发布.第一个问题是这一行(我在调试后添加了一个日志行)...

 NSIndexPath *indexPath = [settingsTableView indexPathForCell:(UITableViewCell *)[sender superview]];
 NSLog(@"Changed %@ <-**-> %@", [sender superview], indexPath );
Run Code Online (Sandbox Code Playgroud)

日志显示....

IOS 7

 2013-09-11 22:18:02.985 BusTimes[21013:a0b] Changed <UITableViewCellScrollView: 0xbfc1c80; frame =  (0 0; 320 44); clipsToBounds = YES; autoresize = W+H; gestureRecognizers = <NSArray: 0xbfc1e70>; layer = <CALayer: 0xbfc1540>; contentOffset: {0, 0}> <-**-> (null)

 2013-09-11 22:18:08.577 BusTimes[21013:a0b] Changed <UITableViewCellScrollView: 0xbfc62d0; frame = (0 0; 320 44); clipsToBounds = YES; autoresize = W+H; gestureRecognizers = <NSArray: 0xbfc64c0>; layer = <CALayer: 0xbfc5b90>; contentOffset: …
Run Code Online (Sandbox Code Playgroud)

uitableview ios6 ios7

15
推荐指数
1
解决办法
4154
查看次数

标签 统计

ios7 ×2

uitableview ×2

ios ×1

ios6 ×1

objective-c ×1