Quote:
Originally Posted by soku
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];