I have a table view with tall cells. About 300 in height. The cells are custom and have an associated nib. In cellForRowAtIndexPath, I access an object in an array using indexPath.row. The object has properties, which I assign to labels on the custom cell. This works fine for the first two cells. Once I scroll enough for the third cell to get created, the app crashes.
I have NSZombieEnabled set and here is the output:
2010-04-19 21:48:13.360 MyApp[54463:207] *** -[CALayer release]: message sent to deallocated instance 0xfc4e50
(gdb) continue
2010-04-19 21:48:18.382 MyApp[54463:207] *** NSInvocation: warning: object 0xfc4e50 of class '_NSZombie_CALayer' does not implement methodSignatureForSelector: -- trouble ahead
2010-04-19 21:48:18.383 MyApp[54463:207] *** NSInvocation: warning: object 0xfc4e50 of class '_NSZombie_CALayer' does not implement doesNotRecognizeSelector: -- abort
(gdb) continue
Program received signal: “EXC_BAD_ACCESS”.
(gdb)
I'm not sure what is deallocated. How can I trace this to the source?
-- EDIT --
Adding cellForRowAtIndexPath implementation:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
OrderCell *cell = (OrderCell*)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"OrderCellView" owner:self options:nil];
cell = [nib objectAtIndex:0];
}
// Set up the cell...
if(self.rows != nil){
id obj = [self.rows objectAtIndex:indexPath.row];
cell.orderId.text = [NSString stringWithFormat:@"%@",[obj objectForKey:@"OrderId"]];
cell.orderName.text = [NSString stringWithFormat:@"%@",[obj objectForKey:@"OrderName"]];
}
return cell;
}