I am having a problem locating a bug in my code. Here is an exerpt:
It crashes at the "cell.text = store.storeName;" line. I have noticed that when I print out storeName at initialization, it is fine. So it is reading the string from the SQLite DB. I also checked the string right after I released the original Store object (after storing it in the appDelegate's "stores" NSMutableArray)
But what I try to print the string within the function above, it dies a horrible death.
I am using the SQLite Books sample code as a model, and that project runs just fine. I am stumped. Anybody have any ideas where the storeName NSString may be getting hosed?
Thanks,
Hickman
Code:
- (UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *cell = [self.tableView dequeueReusableCellWithIdentifier:@"MyIdentifier"];
if (cell == nil) {
// Create a new cell. CGRectZero allows the cell to determine the appropriate size.
cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:@"MyIdentifier"] autorelease];
}
AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
Store *store = (Store *)[appDelegate.stores objectAtIndex:indexPath.row];
cell.text = store.storeName;
return cell;
}
It crashes at the "cell.text = store.storeName;" line. I have noticed that when I print out storeName at initialization, it is fine. So it is reading the string from the SQLite DB. I also checked the string right after I released the original Store object (after storing it in the appDelegate's "stores" NSMutableArray)
But what I try to print the string within the function above, it dies a horrible death.
I am using the SQLite Books sample code as a model, and that project runs just fine. I am stumped. Anybody have any ideas where the storeName NSString may be getting hosed?
Thanks,
Hickman