Re: Binding/KVC : implicit and explicit invocation of description method
Re: Binding/KVC : implicit and explicit invocation of description method
- Subject: Re: Binding/KVC : implicit and explicit invocation of description method
- From: Max Barel <email@hidden>
- Date: Sat, 2 Oct 2004 13:57:13 +0200
- Resent-date: Sat, 2 Oct 2004 14:00:36 +0200
- Resent-from: Max Barel <email@hidden>
- Resent-message-id: <email@hidden>
- Resent-to: email@hidden
Le 2 oct. 04, à 06:01, Scott Anguish a écrit :
description
- (NSString *)description
Returns a string that representsthe contents of the receiver,
formatted as a property list.If each key in the receiver is an
NSString the entries are listedin ascending order, by key. Otherwise,
the order in which the entriesare listed is undefined.
So, yes, it's documented. I'm not sure that's how I'd get a plist to
do anything with though. I'd suggest instead
using + dataFromPropertyList:format:errorDescription:
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.
- Why an explicit call to description method is then wrong? I suppose
it end up as NSDictionary.description.description, but why?
It's a bug. If the object is being observed via automatic
observing, a proxy is used in place of the original object. In this
case description's behavior was altered so that it returns different
information when the object is being observed.
If it's in a framework, perhaps try descriptionWithLocale: if it's
supported... I'm not sure I've found a situation where this couldn't
be worked around
Your suggestion to use other description... methods confuses me more.
Can you bind an object.value (with IB) to a method with parameter? My
understanding of valid accessor names was: NO.
BTW, beside of the bug due to the overloading for the description
method, would it be a valid accessor? I'm not sure.
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