Re: coding NSNumber in NSArray?
Re: coding NSNumber in NSArray?
- Subject: Re: coding NSNumber in NSArray?
- From: Kyle Sluder <email@hidden>
- Date: Mon, 14 Sep 2009 12:33:30 -0700
On Mon, Sep 14, 2009 at 9:42 AM, jon <email@hidden> wrote:
> - (void)setTypeOfLeaf:(NSNumber*)flag
> {
> if (!typeOfLeaf || ![typeOfLeaf isEqual:flag])
> {
> [typeOfLeaf release];
> typeOfLeaf = [flag retain];
> }
> }
This is how how you should be implementing this setter. In
particular, the !typeOfLeaf condition shouldn't be there.
- (void)setTypeOfLeaf:(NSNumber *)flag {
[flag retain];
[typeOfLeaf release];
typeOfLeaf = flag;
}
Also, we need to see your -typeOfLeaf method.
--Kyle Sluder
_______________________________________________
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