• 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: Scott Anguish <email@hidden>
  • Date: Tue, 5 Oct 2004 00:44:46 -0400


On Oct 4, 2004, at 6:44 PM, Max Barel wrote:


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


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

Yes, the description method is documented, I know and that's why I tried to use it. That's not the point.
What is undocumented is the implicit CALL to this method, when an NSTextView.value is bound to an NSDictionary object.

    Oh, I see.

    well, value expects an NSString... if you try and NSLog a dictionary object, you'll see that it also calls description.

    is this documented?  Well, it's nothing to do with bindings, so I'm not sure. 
    why are you trying to hook an NSDictionary up directly to a next view?

But I don't! I was precisely trying to get a string representation of the dictionary to display its content (read-only) in a text view (in this precise case, to display a NSScreen description). That's why I used an KVC accessor of the form anNSDictionary.description, which doesn't work. And I tried the direct bind to the object while trying figure the problem.

I'm currently learning and testing the binding layer to use it in my next app.

    and unfortunately you've come up across one of the bugs...


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.


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


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



    If not, why the runtime implicitly calls the description method that you can't use an an accessor.

IMHO, this is misleading.


On Oct 4, 2004, at 6:44 PM, Max Barel wrote:


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


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

Yes, the description method is documented, I know and that's why I tried to use it. That's not the point.
What is undocumented is the implicit CALL to this method, when an NSTextView.value is bound to an NSDictionary object.

    Oh, I see.

    well, value expects an NSString... if you try and NSLog a dictionary object, you'll see that it also calls description.

    is this documented?  Well, it's nothing to do with bindings, so I'm not sure. 
    why are you trying to hook an NSDictionary up directly to a next view?

But I don't! I was precisely trying to get a string representation of the dictionary to display its content (read-only) in a text view (in this precise case, to display a NSScreen description). That's why I used an KVC accessor of the form anNSDictionary.description, which doesn't work. And I tried the direct bind to the object while trying figure the problem.

I'm currently learning and testing the binding layer to use it in my next app.

    and unfortunately you've come up across one of the bugs...


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.


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


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



    If not, why the runtime implicitly calls the description method that you can't use an an accessor.

IMHO, this is misleading.


    Yep, and all this is because of that description bug... Want me to smack the engineer for you when I'm on campus in a couple of weeks? :-)


_______________________________________________
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 : 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>)

  • Prev by Date: Re: How to avoid warning with objc_msgSend
  • Next by Date: Re: Help with crashing cocoa/CoreFoundation app
  • 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 : valid accessor for framework objects. (was: implicit and explicit invocation of description method)
  • Index(es):
    • Date
    • Thread