• 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: Sun, 5 Jul 2009 07:01:33 -0700

On 4-Jul-09, at 21:53 , mmalc Crawford wrote:
Use of accessor methods is described plainly here:
<http://developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/Articles/mmPractical.html#//apple_ref/doc/uid/TP40004447-SW4 >

If I understand this example correctly, I could do the same thing like this:


Header:
   NSNumber *count;
   ...
   @property(retain,readwrite) NSNumber *count;

Implementation:
   @synthesize count;
   ...
   (void)dealloc {
      [count release];
   }

This would automatically create the two accessor methods described in this section of the docs. Then whenever I want to do something with the variable, I do things like this:

   NSInteger otherVar = [self.count integerValue];
   self.count = [NSNumber numberWithInteger:0];

Have I finally got it right?

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: Shawn Erickson <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>)
 >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: Movable Document Modal Dialogs
  • Next by Date: Wrap to Page method
  • Previous by thread: Re: Yet another memory management question
  • Next by thread: Re: Yet another memory management question
  • Index(es):
    • Date
    • Thread