• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Objects not being added to array
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Re: Objects not being added to array (From: "Matthew Callis" <email@hidden>)

  • Prev by Date: Re: CoreData/NSManagedObject accessor performance problems
  • Next by Date: Using bindings to make an NSPopupButton to assign an array filter predicate
  • Previous by thread: Re: Objects not being added to array
  • Next by thread: Re: Objects not being added to array
  • Index(es):
    • Date
    • Thread