• 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: Binding/KVC : valueForKey: and NSDictionary (was: valid accessor for framework objects. (was: implicit and explicit invocation of description method))
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Binding/KVC : valueForKey: and NSDictionary (was: valid accessor for framework objects. (was: implicit and explicit invocation of description method))


  • Subject: Re: Binding/KVC : valueForKey: and NSDictionary (was: valid accessor for framework objects. (was: implicit and explicit invocation of description method))
  • From: Max Barel <email@hidden>
  • Date: Tue, 5 Oct 2004 23:29:40 +0200


Le 5 oct. 04, à 15:54, Max Barel a écrit :

In a more general description:
- The NSArraycontroller manage an array of NSScreen (tried both NSArray and mutable copy).
- Its object class is defined as NSScreen.
- NSScreen objects have a property named deviceDescription, of class NSDictionary.

No accessor of the form selection.deviceDescription.amethod[an NSArraycontroller] works.
Accessors of the form selection.deviceDescription.aKey (e.g selection.deviceDescription.NSDeviceSize) work once. Changing the initial selection crash on signal 10.

Can we suspect a weird behavior with NSDictionary to-one relationship?

After more testing and cross-reading of the valueForKey: method documentation, I come with a differently formulated question:

The valueForKey: method is defined in the NSKeyValueCoding protocol of NSObject. It is also overloaded in NSDictionary.

Is the NSDictionary version of the method conforming to the NSKeyValueCoding?
I understand that the overloaded version add the ability to find a value from a key (in the NSDictionary sense), but it is still able to find a public method, as stated by the first rule of KVC:

valueForKey:
- (id)valueForKey:(NSString *)key
...
The default implementation works as follows:
1. Searches for a public accessor method based on key. For example, with a key of “lastName”, valueForKey: looks for a method named getLastName or lastName
...

For example, none of the test I made allowed me to access the value from the -count method of an NSDictionary object using KVC.

Max
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden
  • Follow-Ups:
    • Re: Binding/KVC : valueForKey: and NSDictionary (was: valid accessor for framework objects. (was: implicit and explicit invocation of description method))
      • From: mmalcolm crawford <email@hidden>
References: 
 >Binding/KVC : implicit and explicit invocation of description method (From: Max Barel <email@hidden>)
 >Re: Binding/KVC : implicit and explicit invocation of description method (From: Scott Anguish <email@hidden>)
 >Re: Binding/KVC : valid accessor for framework objects. (was: implicit and explicit invocation of description method) (From: Max Barel <email@hidden>)
 >Re: Binding/KVC : valid accessor for framework objects. (was: implicit and explicit invocation of description method) (From: Scott Anguish <email@hidden>)
 >Re: Binding/KVC : valid accessor for framework objects. (was: implicit and explicit invocation of description method) (From: Max Barel <email@hidden>)

  • Prev by Date: Re: Default button surrounded by black square for Panther, not Jaguar
  • Next by Date: Re: MVC paradigm: multiple controllers?
  • Previous by thread: Re: Binding/KVC : valid accessor for framework objects. (was: implicit and explicit invocation of description method)
  • Next by thread: Re: Binding/KVC : valueForKey: and NSDictionary (was: valid accessor for framework objects. (was: implicit and explicit invocation of description method))
  • Index(es):
    • Date
    • Thread