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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to