Quote:
Originally Posted by BrianSlick
Code:
// declare array
[self setFieldDataArray:[[NSMutableArray alloc] init]];
[self setSectionArray:[[NSMutableArray alloc] init]];
These are leaks. Never do alloc/init in the same line as you assign a property. It should be three lines, like this:
Code:
NSMutableArray *fieldArray = [[NSMutableArray alloc] init];
[self setFieldDataArray: fieldArray];
[fieldArray release], fieldArray = nil;
Code:
// name
NSString *trackName = [[self trackDict] objectForKey:kNameKey];
if (trackName == nil)
trackName = @"";
[[self fieldDataArray] addObject:trackName];
[self setNameText:trackName];
[trackName release];
I'm going to say that's the problem. trackName is autoreleased.
By the way, comment "when i click "back button" on the navigationcontroller" would have been a useful piece of information before. That's most likely when the autorelease pool is getting drained. I thought you meant you were literally crashing at the aforementioned line of code.
|
I have fixed the things you said, but when i try to release trackDictionary, it still crashes when i click "back button". very weird.
but if i dont release it, its fine.