views:

32

answers:

2

I have a project with two Info.plist files (one for each target). In the second Info.plist, when I add a field it shows the internal name instead of the English name. For example UISupportedInterfaceOrientations instead of "Supported Interface Orientations".

Also, when I click on the dropdown list to see all options, some of the options that are available in the first .plist file are not in the second (eg CFBundleIconFiles). The two problems are really the same thing (anything which shows the internal name does not appear in the dropdown).

The Bundle Verion is 1.1 in both files, the CFBundleInfoDictionaryVersion are both the same, as are the plist version and the DTD.

What's stopping the second plist from giving me these options? Thanks.

alt text

+1  A: 

Typically, there are times when not all options are shown. If you know it is supposed to exist, you can just add the key (via copy/paste) from the XML file of the other info.plist. I normally just open it up as XML and work in that mode (which gives non-English names).

All keys can be found here: http://developer.apple.com/iphone/library/documentation/General/Reference/InfoPlistKeyReference/Articles/AboutInformationPropertyListFiles.html

In the latest XCode, it has been converting everything automatically to English names for me though even when I try to paste as a non-English name in the property list editor.

iWasRobbed
Even cutting and pasting won't work for me. In frustration I copied the entire XML contents from one to the other and it still didn't work.
nevan
Hmmm... now that is indeed strange. Are you saying copying/pasting the XML didn't show either the internal OR the external keys once you saved it? I've never had that happen before and it seems buggy to me if that's the case.
iWasRobbed
No, when I copied and pasted, it showed both internal and English labels for the keys. They were mixed together, like the image above.
nevan
Ahh... yeah XCode seems to do that at random. I haven't found a way to change that but it is indeed annoying
iWasRobbed
Thanks for the help. I might ask on the Apple dev boards, see if the Xcode officials regard this as a bug.
nevan
+1  A: 

Xcode has a couple of different editors to show the contents of plist files. One of them is the generic plist editor, which shows the names of the keys without translation. The plist editor can also be in the specialized Info.plist mode, where it knows about the structure of this special type of plist file and translates keys to english.

I don't know how Xcode decides which editor to use, so the following is just guessing: I assume Xcode looks into the selected target to check the path to the Info.plist file and if it is the edited file, uses the specialized editor. So if you have one target selected, but open the other targets Info.plist it might use the generic editor instead.

Xcode also manages file types for each file in the project. You can override Xcode's automatic guesses by opening the file's settings (click on the file in the outline view and press command-I). Maybe there's a file type to identify Info.plist files.

As a last resort, you can always open the file by right clicking it in the outline view. In the context menu from "Open as ..." you can choose how to open it. I usually use "Source Code File" since I like to see the original XML.

Nikolai Ruhe
Thanks for the info. I tried the other "Open As..." from the menu, and it seemed like it was using the correct type. I like to see the English names, so I can be sure it's not mistyped, but I view them in BBEdit too to be sure.
nevan