• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSDictionary valueForKey: and @ character at start of NSString
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSDictionary valueForKey: and @ character at start of NSString


  • Subject: Re: NSDictionary valueForKey: and @ character at start of NSString
  • From: Buddy Kurz <email@hidden>
  • Date: Tue, 15 May 2007 06:10:56 -0700

How about prepending some other character when the key is stored and removing it when reading the key to get the string

NSString * myKey = [NSString stringWithFormat:@"-%@",userString];

NSString * userString = [myKey stringFromIndex:1];


On May 14, 2007, at 10:30 PM, Joe Goh wrote:

On 5/15/07, Sam Stigler <email@hidden> wrote:
Is there an escape character for "@"?

Escaping the character is irrelevant in this case because the @ character is already inside the NSString and NSDictionary valueForKey: is explicitly checking for this character to invoke [super valueForKey:] instead of objectForKey:

I could of course make this all work by just stripping the @ character
from the NSString, but as this is input from the user, its much better
to preserve it.

Nice try though Sam,
Regards,
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

_______________________________________________

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


  • Follow-Ups:
    • Re: NSDictionary valueForKey: and @ character at start of NSString
      • From: "Joe Goh" <email@hidden>
References: 
 >NSDictionary valueForKey: and @ character at start of NSString (From: "Joe Goh" <email@hidden>)
 >Re: NSDictionary valueForKey: and @ character at start of NSString (From: Sam Stigler <email@hidden>)
 >Re: NSDictionary valueForKey: and @ character at start of NSString (From: "Joe Goh" <email@hidden>)

  • Prev by Date: re:Counting NSMutableSet
  • Next by Date: Re: Counting NSMutableSet
  • Previous by thread: Re: NSDictionary valueForKey: and @ character at start of NSString
  • Next by thread: Re: NSDictionary valueForKey: and @ character at start of NSString
  • Index(es):
    • Date
    • Thread