Re: Cocoa-dev Digest, Vol 2, Issue 490
Re: Cocoa-dev Digest, Vol 2, Issue 490
- Subject: Re: Cocoa-dev Digest, Vol 2, Issue 490
- From: Jack <email@hidden>
- Date: Sat, 09 Apr 2005 01:25:40 +0200
> If foo has no "blob" accessor, then [foo blob] throws a warning at
> compile time, while [foo valueForKey:@"blob"] does not, instead
> erroring at runtime.
I don't really understand what all the complaining is about. What is the
problem with runtime? This is what "(id)valueForUndefinedKey:(NSString
*)key" is all about. You can print out an error and the key letting you know
exactly where the problem is and return NIL, it's good practice to check for
NIL and act appropriately. You can even tell the bindings what to do with
NIL. One good thorough run of your program will quickly show any errors as
well. I don't know about you but I run and test every implementation of
something right after I code it, so it doesn't even involve an extra step
for me.
Also there no reason to use KVC with core data. You can go ahead an use your
own accesor method directly and forget about KVC, just like you can with all
objects that comply with the KVC protocol. This is what I love about Cocoa
there so many levels to it. You can take care of things at the accesor
method at the delegate, at the notification, with KVC...
_______________________________________________
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