I am trying to do nslog on a float value using :
NSLog(@"THE LOG SCORE : %@", x);
and I have also tried :
NSLog(@"THE LOG SCORE : %@", [NSString stringWithFormat:@"%@", x]);
but it doesnt work! any thoughts why it wouldnt work? the error I get is EXC_BAD_ACCESS
thanks
The %@ is intended to work on an object, a float is not an object. To do a float try:
NSLog(@"THE LOG SCORE : %f", x);
Here's a helpful article
http://vormplus.be/blog/article/using-nslog-to-debug-your-iphone-application
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With