• 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: Managed Object with Getter
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Managed Object with Getter


  • Subject: Re: Managed Object with Getter
  • From: Richard Somers <email@hidden>
  • Date: Wed, 13 Jan 2010 17:29:33 -0700

On Jan 13, 2010, at 7:14 AM, Jim Correia wrote:

This style is typically used for non-object BOOL values. If you use it for an NSNumber attribute, you run the risk of someone familiar with the pattern assuming it is a BOOL property and writing

	if ([managedObject isSelected]) {

	}

which will of course be be true whenever the property is non-nil, no regardless of the actual value.

Thanks for the reply and the information. The attribute is a bool in the Xcode data modeler. When you copy the Obj-C 2.0 method declarations for the bool attribute to the clipboard this is what you get.


     @property (nonatomic, retain) NSNumber *selected;

So I assume that Core Data frameworks default is to use a NSNumber for a bool value.

--Richard



_______________________________________________

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: Managed Object with Getter
      • From: Jim Correia <email@hidden>
References: 
 >Managed Object with Getter (From: Richard Somers <email@hidden>)
 >Re: Managed Object with Getter (From: Kyle Sluder <email@hidden>)
 >Re: Managed Object with Getter (From: Richard Somers <email@hidden>)
 >Re: Managed Object with Getter (From: Jim Correia <email@hidden>)

  • Prev by Date: Re: Problem printing offscreen PDFViews
  • Next by Date: Re: Managed Object with Getter
  • Previous by thread: Re: Managed Object with Getter
  • Next by thread: Re: Managed Object with Getter
  • Index(es):
    • Date
    • Thread