• 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
[Q] Garbage strings appened to a string
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Q] Garbage strings appened to a string


  • Subject: [Q] Garbage strings appened to a string
  • From: JongAm Park <email@hidden>
  • Date: Mon, 26 Sep 2005 21:20:02 -0700

Hello.

When I tried manipulating strings, I found something strange. Probably I don't understand how the NSString works well.

A NSTextField is connected to an outlet. Let's call it myTextField.

Now, an NSString is retrieved from it.

   NSString *aString = [myTextField stringValue];

If it is printed or put into another text field like this

NSString *outputString = [ NSString stringWithFormat:@"%S is being typed.", [aString cStringUsingEncoding: NSUnicodeStringEncoding] ];

[outputTextField setStringValue:outputString];


Let's say that an input string is "Hello, Jane", and there is an OK button which put the input string into the outputTextField with the format above.


Whenever the OK button is pressed, some garbages are appended to the "Hello, Jane". Sometimes it is OK, though.
Can anyone tell me why this inconsistent result is obtained? Is there something wrong about the syntax? (Other than probable typo. : ) )



Thank you. JongAm Park


_______________________________________________ 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: [Q] Garbage strings appened to a string
      • From: Bill Bumgarner <email@hidden>
    • Re: [Q] Garbage strings appened to a string
      • From: Nick Zitzmann <email@hidden>
  • Prev by Date: interactive command line apps
  • Next by Date: Re: [Q] Garbage strings appened to a string
  • Previous by thread: interactive command line apps
  • Next by thread: Re: [Q] Garbage strings appened to a string
  • Index(es):
    • Date
    • Thread