Re: Displaying a number with Quartz
Re: Displaying a number with Quartz
- Subject: Re: Displaying a number with Quartz
- From: Michael Vannorsdel <email@hidden>
- Date: Tue, 26 May 2009 07:34:55 -0600
NSString's stringWithFormat:, or using sprintf/asprintf with the %d
format:
char * str;
if(asprintf(&str, "%d", intval) < 0)
//error
CGContextShowTextAtPoint...
free(str);
or if you know the possible max size of the text:
char strbuffer[MAX];
if(snprintf(strbuffer, MAX, "%d", intval) < 0)
//error
CGContextShowTextAtPoint...
On May 25, 2009, at 1:16 AM, Pierre Berloquin wrote:
I need to display an int with CGContextShowTextAtPoint
that only accepts char arrays.
How do I go about it ?
I can't find how to convert an int into a char* in objective-C !!
_______________________________________________
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