FROM : Quincey Morris
DATE : Mon Apr 28 22:03:25 2008
On Apr 28, 2008, at 11:32, Robert Cerny wrote:
> Actually,
> it's not getting called at all. Is it because my method is defined
> in category? As I wrote already, I'm able to call my methods from
> gdb so my category is up and running
>
> NSLog(@"%@", [[[ppl arrangedObjects] objectAtIndex:0] lastName]);
>
> as opposed to
> Value (ABPeople.arrangedObjects.lastName)
Because the view uses a binding, it's actually going to call
'valueForKeyPath:@"lastName"', isn't it? Normally, you'd expect that
to end up at your 'lastName' method via [NSObject valueForKey:], but
since it isn't getting to your custom accessor, you know that
'valueForKey:@"lastName"' is itself returning nil or an empty string.
This suggests to me that ABRecord (the superclass of ABPerson, the
documentation says) may override valueForKey: with new behavior that
doesn't call custom accessors or return anything useful. If that's so,
I can only speculate that it's to prevent you using valueForKey when
you're "supposed" to use valueForProperty instead.
Does that sound plausible?
DATE : Mon Apr 28 22:03:25 2008
On Apr 28, 2008, at 11:32, Robert Cerny wrote:
> Actually,
> it's not getting called at all. Is it because my method is defined
> in category? As I wrote already, I'm able to call my methods from
> gdb so my category is up and running
>
> NSLog(@"%@", [[[ppl arrangedObjects] objectAtIndex:0] lastName]);
>
> as opposed to
> Value (ABPeople.arrangedObjects.lastName)
Because the view uses a binding, it's actually going to call
'valueForKeyPath:@"lastName"', isn't it? Normally, you'd expect that
to end up at your 'lastName' method via [NSObject valueForKey:], but
since it isn't getting to your custom accessor, you know that
'valueForKey:@"lastName"' is itself returning nil or an empty string.
This suggests to me that ABRecord (the superclass of ABPerson, the
documentation says) may override valueForKey: with new behavior that
doesn't call custom accessors or return anything useful. If that's so,
I can only speculate that it's to prevent you using valueForKey when
you're "supposed" to use valueForProperty instead.
Does that sound plausible?
| Related mails | Author | Date |
|---|---|---|
| Robert Cerny | Apr 28, 16:40 | |
| I. Savant | Apr 28, 16:46 | |
| Robert Cerny | Apr 28, 16:56 | |
| I. Savant | Apr 28, 17:03 | |
| Robert Cerny | Apr 28, 17:13 | |
| I. Savant | Apr 28, 17:20 | |
| Robert Cerny | Apr 28, 19:06 | |
| I. Savant | Apr 28, 19:19 | |
| Robert Cerny | Apr 28, 20:32 | |
| I. Savant | Apr 28, 20:50 | |
| Quincey Morris | Apr 28, 22:03 | |
| I. Savant | Apr 28, 22:09 |






Cocoa mail archive

