• 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: Beginners question on String handling
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Beginners question on String handling


  • Subject: Re: Beginners question on String handling
  • From: Dave Hersey <email@hidden>
  • Date: Wed, 26 Mar 2008 00:26:58 -0400

Yeah, you could do it like that too. Ok, "NSString and NSMutableString" are your friends. : )

Definitely read the class reference docs on them, you'll use them extensively. Remember, you can just option-click on the text "NSString" in your source to bring up the docs. That's something that's not always obvious when you're starting out with Xcode, but it's your friend too. Many friends.

- d

On Mar 26, 2008, at 12:08 AM, William Hunt wrote:
I'm going to jump in on this one, since it's one I think I might actually know. :)

Assuming you have two NSTextField *'s, probably declared in your controller's or document's interface...

NSTextField *lastNameField;
NSTextField *firstNameField;

Then the way to get NSString * values from them would be:

NSString *lastName = [lastNameField stringValue];
NSString *firstName = [firstNameField stringValue];

Then you could combine them...

NSString *fullName = [NSString stringWithFormat: @"%@, %@", lastName, firstName];

Is that what you were looking for? If not, then you're probably already beyond the scope of my expertise. ;) Fortunately there are myriad geniuses lying around these groups.

Wil

--
Wil Hunt

"Life is the art of drawing sufficient conclusions from insufficient premises."
-- Samuel Butler



On Mar 25, 2008, at 8:53 PM, Alfred Schmidt wrote:
Can someone point be to the procedure on how to quickly calculate a combined string from separate Text fields

• or point me to some sample code that handles separate strings some fields to combine them.

Thanks can't seem make any progress in this area.

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Beginners question on String handling (From: Alfred Schmidt <email@hidden>)
 >Re: Beginners question on String handling (From: William Hunt <email@hidden>)

  • Prev by Date: Re: Beginners question on String handling
  • Next by Date: Re: How to use install location, specifically with prefs pane
  • Previous by thread: Re: Beginners question on String handling
  • Next by thread: Re: Beginners question on String handling
  • Index(es):
    • Date
    • Thread