Re: Integer to String
Re: Integer to String
- Subject: Re: Integer to String
- From: j o a r <email@hidden>
- Date: Mon, 7 Jul 2003 09:21:04 +0200
On Monday, Jul 7, 2003, at 08:53 Europe/Stockholm, John Lombardo wrote:
Is there a way to set a string in a NSTextField control sing an integer
without having to use NSNumber to take in a stringValue and spit out an
intValue?
// Int and string conversions, look in the documentation for NSString
// int -> NSString -> int
int myInt = 5;
NSString *intStr = [NSString stringWithFormat: @"%d", myInt];
int newInt = [intStr intValue];
// Int values and text fields, look in the documentation for NSControl
// int -> NSTextField -> int
[myTextField setIntValue: myInt];
int yetAnotherInt = [myTextField intValue];
j o a r
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.