NSString: newline escape in plist

Viewed 18416

I'm writing a property list to be in the resources bundle of my application. An NSString object in the plist needs to have line-breaks in it. I tried \n, but that doesn't work. What do I do to have newlines in my string in the plist?

Thanks.

5 Answers

If you're editing the plist in Xcode's inbuild plist editor, you can press option-return to enter a line break within a string value.

Edit your plist using a text editor instead of Xcode's plist editor. Then you simply put line breaks in your strings directly:

<string>foo
bar</string>
Related