• 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 : 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 : valid accessor for framework objects. (was: implicit and explicit invocation of description method)


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


Le 5 oct. 04, à 06:44, Scott Anguish a écrit :

Le 2 oct. 04, à 23:44, Scott Anguish a écrit :


On Oct 2, 2004, at 7:57 AM, Max Barel wrote:

I'm aware of what can be done with categories and -more binding specific- with value transformers.
What is still unclear for me is: What is a valid accessor for a framework object?

    any method in for form
    -(returnsomevalue)theAccessor
    can be called using KVC.

The NSDictionary interface does not show any public ivar. Does this means that it has NO KVC property?
Or else, are parameterless methods valid accessors to the object information?

    as long as they return a value, yes.

Thanks. That's precisely the info I was seeking for.

  If yes, why another method returning an NSString does not work neither :
        - (NSString *)descriptionInStringsFileFormat;

    that I didn't know about.. what does it print?

The [anNSDictionary description] method returns:

{
NSDeviceBitsPerSample = 8;
NSDeviceColorSpaceName = NSCalibratedRGBColorSpace;
NSDeviceIsScreen = YES;
NSDeviceResolution = <42900000 42900000 >;
NSDeviceSize = <44a00000 44558000 >;
NSScreenNumber = 69666816;
}

The [anNSDictionary descriptionInStringsFileFormat] method returns:

"NSDeviceSize" = <44a00000 44558000 >;
"NSDeviceColorSpaceName" = "NSCalibratedRGBColorSpace";
"NSDeviceResolution" = <42900000 42900000 >;
"NSDeviceBitsPerSample" = 8;
"NSScreenNumber" = 69666816;
"NSDeviceIsScreen" = "YES";

Both work as expected when called "normally" and the result is assigned to the TextView with Outlet scheme.
Neither work when accessed using binding/KVC.

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?

Anyway this is not the main point. As soon as you know a bug, it can be avoided. You just have to know it.

The truly clarifying point is the clear definition of what can be a KVC accessor.
_______________________________________________
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: Max Barel <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>)

  • Prev by Date: Re: Embedding Omni Frameworks
  • Next by Date: Re: How to avoid warning with objc_msgSend
  • 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