• 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
NSScanner Madness
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: NSScanner Madness
      • From: "M. Uli Kusterer" <email@hidden>
    • Re: NSScanner Madness
      • From: Shawn Erickson <email@hidden>
  • Prev by Date: Re: Which class methods return autoreleased objects?
  • Next by Date: Re: NSScanner Madness
  • Previous by thread: [SOLVED] Re: NSView not resizing when parent view resizes
  • Next by thread: Re: NSScanner Madness
  • Index(es):
    • Date
    • Thread