Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Draw This
($0.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 07-27-2009, 01:46 AM   #26 (permalink)
svveet
Registered Member
 
Join Date: Jun 2009
Location: Australia
Posts: 180
svveet is on a distinguished road
Default

Quote:
Originally Posted by BrianSlick View Post
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.
svveet is offline   Reply With Quote
 

» Advertisements
» Stats
Members: 175,014
Threads: 93,862
Posts: 401,918
Top Poster: BrianSlick (7,962)
Welcome to our newest member, Shimi574
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 09:11 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.