iphoneobjective-cplist

Plist contains the "&" character


I'm having a .plist file which has some values with the "&" sign, for example "M&I". When I save the file to the document folder and load it from there, I'm getting an empty dictionary. Any idea to how to fix this issue?


Solution

  • If you are directly modifying the XML file, you have to escape certain characters - & should be escaped using the XML entity &. If you use the editors, this should be done automatically for you.

    If you use CDATA sections instead, you don't have to escape the characters.