NSDictionary valueForKey: and @ character at start of NSString
NSDictionary valueForKey: and @ character at start of NSString
- Subject: NSDictionary valueForKey: and @ character at start of NSString
- From: "Joe Goh" <email@hidden>
- Date: Tue, 15 May 2007 12:48:41 +0800
Hi everyone,
According to the NSDictionary docs for valueForKey: , it says,
"If key does not start with "@", invokes objectForKey:.
If key does start with "@", strips the "@" and invokes [super
valueForKey:] with the rest of the key."
For my app, I need to handle NSString's (sent by the user) with the @
character at its start.
To work around this issue, i've implemented a category on NSDictionary
that simply calls objectForKey: when valueForKey: is invoked.
Is this dangerous? Will I break anything used by Cocoa internally if
I do this? What's the rationale behind this behaviour for
valueForKey: in the first place?
Thanks!
Joe Goh
FunkeeMonk Technology
http://www.funkeemonk.com/
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden