Logging
suggest changeNSLog(@"Log Message!");
NSLog(@"NSString value: %@", stringValue);
NSLog(@"Integer value: %d", intValue);
The first argument of NSLog is an NSString containing the log message format. The rest of the parameters are used as values to substitute in place of the format specifiers.
Formatting works like printf, plus the %@ specifier for an Objective-C object. %@ sends description and does not treat % inside that string as a specifier. It also prints (null) when the object is nil, which this is not:
NSLog(@"%s", [object description].UTF8String);
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents