• 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: Integer to String
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Integer to String (From: John Lombardo <email@hidden>)

  • Prev by Date: Re: Integer to String
  • Next by Date: ANN: PyObjC 1.0b1
  • Previous by thread: Re: Integer to String
  • Next by thread: ANN: PyObjC 1.0b1
  • Index(es):
    • Date
    • Thread