Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 07-05-2009, 03:55 PM   #2 (permalink)
anonymous
high school developer
 
Join Date: Jul 2009
Posts: 63
Default

Quote:
Originally Posted by soku View Post
The string below always stores Object1x as "0" even if item1Obj.center.x is 200 or 300. Does anyone have any idea whats going wrong?
it should be %f not %d. this same thing happened to me and when I changed it to this it worked. its because cgpoint is made up of two cgfloats (x and y) and the string format thingy is %f for floats. oh ya and also you don't need to allocate and initialize nsstrings. they are autorelease so you can just change your code to this:

Code:
NSString *title = [NSString stringWithFormat:@"Object1x=%f", item1Obj.center.x];

Last edited by anonymous; 07-05-2009 at 03:57 PM.
anonymous is offline   Reply With Quote
 

» Advertisements
» Stats
Members: 158,871
Threads: 89,225
Posts: 380,695
Top Poster: BrianSlick (7,129)
Welcome to our newest member, Darmanikles
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 06:48 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.