• 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
display int in cocoa
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

display int in cocoa


  • Subject: display int in cocoa
  • From: "Erfan Aleemullah" <email@hidden>
  • Date: Wed, 10 Oct 2007 14:10:20 -0400

Hi,
I am trying to display an int as a page number in cocoa so the user knows
which page he is currently on.
the page number automatically increments itself.

I looked into NSTextview but could not get it to work.  Most methods accept
type NSString in their setTitle or similar function- so is there a way to
cast an int to NSString?

What would be the best way to display the int in cocoa ?

Error casting code:

int x = 0;

char *a =(char *)x;

NSString* temp2 = [[NSString alloc] initWithCString: a];

I am currently achieving this effect using setTitle of NSButton class and
using a disabled NSButton as the output for the page number.

current = [[NSString alloc] initWithFormat:@"%d",page];

[CurrentPage setTitle:current];

[current release];


Thanks.
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: display int in cocoa
      • From: Chris Hanson <email@hidden>
    • Re: display int in cocoa
      • From: "I. Savant" <email@hidden>
    • Re: display int in cocoa
      • From: John Stiles <email@hidden>
  • Prev by Date: Showing an error message when the string entered in the NSTableView is too long
  • Next by Date: Re: display int in cocoa
  • Previous by thread: Re: Showing an error message when the string entered in the NSTableView is too long
  • Next by thread: Re: display int in cocoa
  • Index(es):
    • Date
    • Thread