Reputation: 50278
Unless I'm out of my mind, this was working properly on iOS4. I updated to iOS5, and now it's throwing this bad access error on [indexPath section]
. It's on a UITableView
:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { // Get the cell label and value NSLog(@"section: %@", [indexPath section]); /* BAD ACCESS ERROR HERE */ ...
Upvotes: 0
Views: 353
Reputation: 28572
The log statement itself is causing the error.
NSLog(@"section: %@", [indexPath section]); /* BAD ACCESS ERROR HERE */
You are trying to log an integer as if it was an object. It should be:
NSLog(@"section: %i", [indexPath section]);
Upvotes: 4