How could I pass the float number by value in obj-c?
- by user313439
- (void)applicationDidFinishLaunching:(UIApplication *)application{
// Override point for customization after application launch
[window makeKeyAndVisible];
[self printFloat:1.3f];
}
- (void)printFloat:(float)f {
NSLog(@"%f",f);
}
I passed the "1.3f" to printFloat, but it was the wrong value (in this case, -2.000000) after "f" received.
And there is a warning that "AppDelegate may not respond to -printFloat:"
Where did I get it wrong?
Thanks.