Chuck Hill wrote on 5/21/06 11:44 AM:
>>     NSArray bindings = new NSArray( new Object [] {
>> (Session)session().valueForKey("user.client.clientName") } );
>>     
> valueForKeyPath not valueForKey

I've been bitten by this one too.

Is there ever a reason to use valueForKey instead of valueForKeyPath? (I
ask this question along the same vein as, "Is the simplicity of always
using addObjectToBothSidesOfRelationshipWithKey worth the potential
performance hit compared to addObjectToPropertyWithKey?")

The NSKeyValueCodingAdditions documentation doesn't allude to any
performance hits, and says its basically implemented in terms of value
for key. Is valueForKey faster? I supposed it would be because it won't
even try to access items along the keypath; it'll just die right away.

As an aside, is it possible for an item to have a valid key containing a
dot? Don't keys eventually map to object properties that have to conform
to java variable names?

zak.
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to