Ususally we use the Format Specifier in NSLog() to show the debug output. For Example:
NSString* name = @"Yuen Ying Kit"; int age = 26; NSLog(@"My name is %@", name); NSLog(@"I am %i years old", age);
You will get a debug output like
List of Format Specifiers
%@ NSString* %d Signed Integer %i Signed Integer %u Unsigned Integer %f Float / Double %x Hexidecimal Integer %X Hexidecimal Integer %o Octal Integer %zu size_t %p Pointer %e Float / Double (in scientific notation) %g Float / Double (as %f or %e, based on value) %s C String %.*s Pascal String %c Character %C Unicode Character %ll Long Long %llu Unsigned Long Long %Lf Long Double
Reference: Using Foundation’s NSLog Function
Done =)
It’s also possible to create strings by format…
int var = 3;
NSString * example = [NSString stringWithFormat:@”This is an example, var: %d”, var];
NSLog(example);
Output: This is an example, var: 3
LikeLike
Yes~ that is a convenient way to create NSString~
Thanks Liam =)
LikeLike
By the way, you website looks cool~
what framework did u use?
LikeLike
Thanks; I wrote a custom framework, but it wasn’t very good.
I’m going to redo the whole site when I get the time/motivation; I’m thinking about using CodeIgniter for it 🙂
At the moment I’m improving my C++ and using App Game Kit:
http://www.appgamekit.com/
LikeLike
ic~ show me when your new website is done =D
LikeLike