Re: Yet another memory management question
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