Re: Objects not being added to array
Re: Objects not being added to array
- Subject: Re: Objects not being added to array
- From: mmalc crawford <email@hidden>
- Date: Sun, 17 Dec 2006 15:57:14 -0800
On Dec 17, 2006, at 1:54 PM, Matthew Callis wrote:
NSArrayController * tapesArray = [[[NSArrayController alloc] init]
retain];
Why are you creating a new array controller here?
And why are you retaining it?
currentDir = directory;
If 'currentDir' is an instance variable, you're almost certainly
causing a memory leak here.
NSMutableArray * bunches = [[NSMutableArray alloc] init];
NSMutableArray * tapeBunch = [[NSMutableArray alloc] init];
bunches = [[bunches retain] autorelease];
tapeBunch = [[tapeBunch retain] autorelease];
These arrays are also leaked.
You should read the relevant memory management documentation, for
example:
<http://developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/>
see also:
<http://www.stepwise.com/Articles/Technical/2001-03-11.01.html>
mmalc
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden