I have some code like below in a UITableView delegate (specifically, the one that fires when you touch a tableview row):

...
NSDictionary *store = [self.stores objectAtIndex:indexPath.row];

// store name is like "NOBLE FINANCE" or "CUSTOMER CREDIT" or such; i.e. two strings seperated by a space
NSString *temp = [store objectForKey:kKeyStoreName];
NSString *temp2 = [store objectForKey:kKeyCity];
NSArray *storeComponents = [temp componentsSeperatedByDelimiter:@" "];
NSString *temp3 = [NSString stringWithFormat:"%@ %@", [storeComponents objectAtIndex:0], temp2];
cell.label.text = temp3;
// [temp3 release];
// [storeComponents release];
// [temp2 release];
// [temp release];
// [store release];
...

If I uncomment any of the object releases above, the app crashes in the simulator, and all the call-stack items are gray (non-user code). But if I don't release them, they'll leak memory, won't they, since iPhone OS doesn't have GC? Note that I've verified that 'store' is actually an NSDictionary, and temp, temp2, and temp3 are non-NIL at the time they're released.

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to