kingston
kingston

Reputation: 1553

memory leak in iphone

I m having leaks at this particular variable:

item = [[NSMutableDictionary alloc] init];

since i m using @property(nonatomic,retain) to synthesize the item. It's obvious to have leaks. I tried autorelease:

item = [[[NSMutableDictionary alloc] init] autorelease];

since I'm storing all the array content in items. The app crashes. I've tried releasing the memory content in dealloc, but there still are leaks. Could you guys help me out?

Upvotes: 0

Views: 69

Answers (1)

NSResponder
NSResponder

Reputation: 16861

If you're synthesizing accessors, why aren't you using them?

Change this:

item = [[[NSMutableDictionary alloc] init] autorelease];

To this:

self.item = [NSMutableDictionary dictionary];

Upvotes: 2

Related Questions