views:

38

answers:

1

Hi,

I have a string that is quite long and complicated, with special characters inside. I want to define this string as a variable, but don't want to escape each of them (because there are so many). I remember that in XML they have a special syntax for that, is there something similar for Objective-C?

Edit: I know I can save the thing in a file and load it easily, but is it possible to do so without a new file? I'm having quite some of them...

+1  A: 

No, you have to escape the characters (though you only have to escape ", \, and control characters... is the string mostly control characters and quotes?)

A better idea might be to put the string in a file. Load it using +[NSString stringWithContentsOfFile:encoding:error:].

Dietrich Epp
nah probably I don't want to do that, create a new file just to put a string :(
phunehehe