display int in cocoa
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