• 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: coding NSNumber in NSArray?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: coding NSNumber in NSArray?
      • From: Jens Alfke <email@hidden>
References: 
 >coding NSNumber in NSArray? (From: jon <email@hidden>)
 >Re: coding NSNumber in NSArray? (From: Randall Meadows <email@hidden>)
 >Re: coding NSNumber in NSArray? (From: jon <email@hidden>)

  • Prev by Date: Re: Garbage collecting live threads
  • Next by Date: Re: Help book content
  • Previous by thread: Re: coding NSNumber in NSArray?
  • Next by thread: Re: coding NSNumber in NSArray?
  • Index(es):
    • Date
    • Thread