Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode plist file - comments vanished, file reformatted

I have just noticed, that if you have an .plist file in your Xcode project (it does not matter whether it is the Info.plist file or other - in my case it was other .plist file) and you edit the file as a source code file (right-click on file Open As->Source Code File) and then you switch back to XML property List (right-click on file Open As->XML Property List), make some changes and save, then all your formatting and comments are dropped when you open it again as a source code.

Does anyone know how to deal with such behaviour? Do I have to stick editing the file as source code ALWAYS?

like image 319
manicaesar Avatar asked Dec 03 '10 13:12

manicaesar


1 Answers

Xcode seems to believe that the <comment> tag corrupts the data. It will also strip out XML-style <!-- comments --> when viewing the plist in Xcode. It seems that a string entry, e.g.

<key>Comment</key>
<string>My comment</string> 

is the only way to reliably persist the comments.

like image 148
Ryan Avatar answered Sep 21 '22 03:09

Ryan