NSScanner Madness
NSScanner Madness
- Subject: NSScanner Madness
- From: Malte <email@hidden>
- Date: Tue, 7 Dec 2004 07:05:28 +0100
Hey *,
i've been trying, reading and searching for a while now but can't figure it out by myself.
Problem:
I have an NSMutableString * read
I have an NSDictionary * table
I have an NSMutableString * translation
"table" consists of entries like these:
[table setObject:@"mySpecialCharacter" forKey:@"regularCharacter"];
So now what i'm obviously trying to do is to scan an entire string (as entered by the user into an NSTextField) and iterate over each character of it, translating it from the "regularCharacter" that is still is, into the "mySpecialCharacter" that i need it to be.
So somehow i need my NSScanner to grind through the entire string, look at each character as an NSString object, look up its equivalent value in my NSDictionary and write that value into my translation string which shall finally be displayed to the user.
8(
I just can't figure it out myself. It'd be absolutely awesome if anyone feels like cranking out a few lines of code or possibly spin my eyeballs onto a nifty tutorial somewhere. Oh..and please don't say "look at the NSScanner doc, it's all right there".
I've absolutely stared at every pixel of it and still.......can't figure it out. :'-(
Thanks a lot.
-malte
Attachment:
PGP.sig
Description: This is a digitally signed message part
_______________________________________________
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