• 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: Yet another memory management question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Yet another memory management question


  • Subject: Re: Yet another memory management question
  • From: DKJ <email@hidden>
  • Date: Sat, 4 Jul 2009 21:31:00 -0700

On 4-Jul-09, at 21:10 , mmalc Crawford wrote:
you should use accessor methods rather than direct variable manipulation

Would declaring all the variables as properties, and then synthesising them, take care of this?


If so, what should I do in dealloc for those variables?

For example, suppose I've got this in the header:

   NSArray *myArray;
...
   @property(retain) NSArray *myArray;

And this in the implementation file:

   @synthesize myArray;

Should dealloc have this:

   [myArray release];

or something like this:

   self.myArray = nil;


Sorry for all these beginner questions; but they will probably prevent a lot more questions later on.


dkj
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please 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


  • Follow-Ups:
    • Re: Yet another memory management question
      • From: mmalc Crawford <email@hidden>
References: 
 >Yet another memory management question (From: DKJ <email@hidden>)
 >Re: Yet another memory management question (From: WT <email@hidden>)
 >Re: Yet another memory management question (From: mmalc Crawford <email@hidden>)

  • Prev by Date: Re: Yet another memory management question
  • Next by Date: Re: Yet another memory management question
  • Previous by thread: Re: Yet another memory management question
  • Next by thread: Re: Yet another memory management question
  • Index(es):
    • Date
    • Thread