• 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: Core Data Entity Relationship -valueForKeyPath: question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Core Data Entity Relationship -valueForKeyPath: question


  • Subject: Re: Core Data Entity Relationship -valueForKeyPath: question
  • From: "Jamie Phelps" <email@hidden>
  • Date: Mon, 30 Jun 2008 21:49:41 -0500

You're right. Someone off list pointed me in the right direction of
NSNumber's -isEqualToNumber: method. Sorry for the noise, everyone!
JP

On Mon, Jun 30, 2008 at 9:42 PM, Quincey Morris <email@hidden>
wrote:

>
> On Jun 30, 2008, at 19:01, Jamie Phelps wrote:
>
>  I have a Core Data entity Item with a relationship "transaction." (It's
>> actually a to-many relationship. I'll adjust the key when I migrate my Core
>> Data model.) My question is about KVC. Can anyone help me understand why the
>> following code always returns YES? I know for a fact that some of my Item
>> objects should return NO for this.
>>
>> -(BOOL)sold{
>>   return ([self valueForKeyPath:@"transaction.@count"] > 0);
>> }
>>
>
> It's not a KVC issue. You called a method that returns a pointer, then you
> compared the pointer to 0 (nil). That's not what you meant to do.
>
>
> _______________________________________________
>
> 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<email@hidden>
>



--
::::::::::::::::::::::::::::::::::::::::::::::::::::::
Jamie Phelps
PO Box 12564
Fort Worth, TX 76110
(817) 673-0036
http://www.jamiephelps.com
_______________________________________________

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

References: 
 >Core Data Entity Relationship -valueForKeyPath: question (From: Jamie Phelps <email@hidden>)
 >Re: Core Data Entity Relationship -valueForKeyPath: question (From: Quincey Morris <email@hidden>)

  • Prev by Date: Re: Core Data Entity Relationship -valueForKeyPath: question
  • Next by Date: Re: Alternative to NSDate's dateWithNaturalLanguageString: ?
  • Previous by thread: Re: Core Data Entity Relationship -valueForKeyPath: question
  • Next by thread: Flowcharts in Cocoa
  • Index(es):
    • Date
    • Thread