Re: Beginners question on String handling
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