Quote:
Originally Posted by carbcycle
Thank for the quick reply.
I understand what you are saying about "ready-to-go" object but not sure how I would use NSLog in my code. Can you demonstrate?
Cheers.
|
Sure. It's important to keep in mind, that NSLog simply takes 1 NSString object, so you either need to concatenate multiple strings together using the method "stringByAppendingString" or you can create one yourself using [NSString stringWithFormat] which allows to use placeholders (such as %d, %f, %@, and so on)
Code:
NSString *s = [NSString stringWithString:@"this is the content of the string"];
NSLog([[NSString stringWithString:@"the string contains: "] stringByAppendingString:s]);
NSLog([NSString stringWithFormat:@"the string contains: %@", s]);
Hope this helps.