Your code should work fine, but it may be incorrect if the transmitted string contains the characters "%" formatting, which may confuse NSLog. For example, try replacing this with your code:
NSString *message = @"My home %folder is: ";
NSLog interprets this "% f" in a bad way.
You can avoid the warning (and danger) by using a string literal with formatting and passing in your lines, for example:
NSLog(@"%@%@", message, [path stringByExpandingTildeInPath]);
You can also check this link:
http://www.cocoabuilder.com/archive/message/cocoa/2009/8/29/243819
Good luck
source share