Does anyone know of an easy way to add a single backslash (\\
) to a NSString
in Objective-C? I am trying to have a NSString *temp = @\"\\/Dat
This is a bug in NSLog. I found a mailing list archive with a message dated in 2002 of someone that filed a bug for this here. The person also said this:
Nothing has been done as far as I can tell. I don't understand how they've done it, but the escaping does work for the string, just not for NSLog.
So I guess you will have to come up with your own implementation of a log message if you really want backslashes.