我打电话UITableView
代表的heightForRowAtIndexPath
内的numberOfRowsInSection
方法,但它给了我一个坏访问错误:的iOS的UITableView numberOfRowsInSection错误访问
- (CGFloat) tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
...
NSLog(@"number of rows in section: %i", [tableView numberOfRowsInSection:[indexPath section]]);
...
}
任何人能告诉我什么是错在这里?
你应该向我们展示你'做什么......因为这可能是相关的。例如,你实际上是否返回一个值。不这样做可能会导致BAD ACCESS。 – Besi
你检查这个问题http://stackoverflow.com/questions/31667986/ios-uitableview-numberofrowsinsection-in-tableview-heightforrowatindexpath-give –