Debugging with NSLog - Get output to console

Logging messages to console are very helpful in processing and debugging your app. Here is a short reminder for using that easy method NSLog .

*NSLog(NSString format, ...)

For printing only a text to console you can write

NSLog(@"my text")

To print a number you can use format specifier

int myNumber = 20;
NSString *myText = @"cats";
NSLog(@"I like to have %i %@", myNumber, myText);

Werbung



comments powered by Disqus

Copyright Dunkel & Iwer GbR | Datenschutzerklärung | Impressum