Earlier quoted context omitted.
If the variable's value contains any format args, e.g. %s, then NSLog (or printf, or whatever string formatting function you're using) will look for another argument, which you didn't actually pass, so it starts looking at garbage stack values. Besides causing incorrect output, this may crash your program, or potentially be a vector for an exploit.
Is there any reason NSLog doesn't filter input to escape these format args?
NSLog(untrusted); bad. NSLog("The user entered %s", untrusted); OK.