• 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: Don't Understand KVC Error Using Array Operators
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Don't Understand KVC Error Using Array Operators


  • Subject: Re: Don't Understand KVC Error Using Array Operators
  • From: Jon Gordon <email@hidden>
  • Date: Tue, 8 Jul 2008 11:58:34 -0400

"D'oh!"
     -H. Simpson

I made the change, and it works perfectly now.  Thanks very much!


On Jul 8, 2008, at 11:44 AM, Ron Lue-Sang wrote:


On Jul 8, 2008, at 8:02 AM, Jon Gordon wrote:

I can't understand why I'm getting an exception when I try to use the array operators.

[SNIPPAGE]

valueForKey and valueForKeyPath are two different KVC accessors. You're using valueForKey and passing a dot-separated string. People usually use dot-separated strings as keypaths and pass them to valueForKeyPath.


<more info than you really need to know to fix this>
It's totally legal to pass dot-separated strings to value for key, but the NSObject built in logic won't be able to find a property or getter method with a sig like "email@hidden". Mainly since that's not a valid obj-c ivar or method name.
</more info than you really need to know to fix this>


use valueForKeyPath instead of valueForKey.

_______________________________________________

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: 
 >Don't Understand KVC Error Using Array Operators (From: Jon Gordon <email@hidden>)
 >Re: Don't Understand KVC Error Using Array Operators (From: Ron Lue-Sang <email@hidden>)

  • Prev by Date: Re: How to create to-many accessor methods at runtime
  • Next by Date: Re: Proposal for metadata interoperability on OS X
  • Previous by thread: Re: Don't Understand KVC Error Using Array Operators
  • Next by thread: problem with IKImageView and filters
  • Index(es):
    • Date
    • Thread