NSString: newline escape in plist

Jonathan Sterling picture Jonathan Sterling · Jan 10, 2010 · Viewed 17.4k times · Source

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.

Answer

Dave Addey picture Dave Addey · Feb 24, 2010

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.