choose info.plist file - iphone

I have localized my Info.plist file, because I have to have different names for the app in different languages.
Since I did that, the project window shows this button: choose info.plist file.
If I click this button a window pops up with no choices. And worst than that, the project will not compile, giving an error error: could not read data from '/Users/user/Documents/myApp/Info.plist': The file “Info.plist” couldn’t be opened because there is no such file.
In fact the message is correct, because Xcode removed it from that location and added a copy of Info.plist to every localized directory (en.lproj, PT.lproj, etc.).
So... how do I fix this?

After fighting with Xcode, the only solution that works is this: http://useyourloaf.com/blog/2010/12/15/localize-iphone-application-name.html
You cannot localize Info.plist as I did. you have to create a strings file and localize that. Some magic links the the strings file to the info.plist.

Related

icon error while updating app to appStore iPhone?

i am trying to update my application using application loader. when i submit the archive file, i got this error
"icon specified in the info.plist not found under the top level app wrapper.icon57.png"!
i have deleted the icons from my project and tried again, but the error exist. is their any way to remove this error?
my info.plist displays these icons
This could help you, i think your filenames are wrong:
I usually put this image in my dashboard so you can fast access to the filenames.
+1 to Mat's answer, also please check out this thread that you may need, I had these errors even with the correct name, so this could be interesting:
Xcode Project Icon files and Organiser Archives artwork
Your app icon must be named as Icon.png which is of size 57*57.You have to rename the image and change that name in the info plist.App icon for retina display should be of size 114*114.And it should be named as Icon#2x.png.Rename ur this image and correct it in the info plist too.And ur splash screen should be named as Default.png
This is sometimes due to the compression that apple does during compiling. You should make sure the file type is correctly set to "Icon". Click on the icon in the project navigator and under "Identity and Type" you can set the File Type to "Icon"
My problem was I ended up with some empty keys in my plist file. I deleted all Icon plist entries, saved the plist, and then added the icons a second time through the Target Summary page.
I tried all of the steps detailed here, many of which have solved this problem previously.
The only way I could get this to work recently was to open the archive file (right click in the Organizer->Archives) and open the actual bundle that's going to be uploaded (show package contents for the archive and then the .app file inside the archive) and copy the icon files directly into there. Resubmitted the previously failed archive then solves the issue.

How to get root.plist to recognize types provided by InAppSettingsKit

I'm having a hard time integrating InAppSettingsKit. First of all, XCode isn't recognizing that the settings.bundle I've added to my project actually contains files. So I have to open that bundle through the Finder to get at the root.plist file.
When i open it, the preference items are restricted to the basic types such as Group, Title, etc and if I try to use something provided by IASK such as PSGroupIdentifier, it immediately reverts to Group.
What am I missing here? What tells the plist file what types are allowable?
First, to see the contents of Settings.bundle, click on it, and in the right pane (the inspector), set File Type to "Application Bundle".
As for Root.plist, these are items that are being used specifically in the Settings app, and as such are limited to a fixed number of options. When you view it from inside XCode, you will see that when you create a new entry, there are only certain entries you can create.

Hierarchical iPhone Settings File problem -- Can't add to Settings.bundle

I'm trying to add an additional iPhone Settings File type to my Settings.Bundle and reference it in my Root.plist as a Child Pane type, but it isn't working. I've followed the documentation from Apple here, but it will not keep the plist file as an "iPhone Settings" type. I'm assuming that is why I can't drag it to my Settings.Bundle file either.
Basically, add a new plist by selecting File > Add New File...; select Resources under iOS, and then select plist type.
Now add some plist properties to the file.
Now right-click and choose "Property List Type" and select "iPhone Settings." You'll notice the keys in the file change. That's good. Save.
Now, click on another file to view that file and click back to the new settings file. Did it change back to the old property names and property type? It does for me, so it's staying as an iPhone Settings file type, and thus isn't working.
Anyone else have this problem? I'm wondering if it is an Xcode thing, or if it's a project preference/option/setting that I need to change.
One obvious thing that caused me to waste some time: kill the settings app after making changes.
It still doesn't save the settings type, but I got it working by copying the plist file into bundle from the command line. You can also right-click the "Settings.bundle" file and select "Show Package Contents" and copy the file in Finder.

How can I make Info.plist show English names?

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 http://img.skitch.com/20100708-ctia2e6yfwgd7twdnepryidayr.jpg
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.
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.
Short Answer
Select iPhone Info.plist from the View > Property List Type menu.
Explanation
This actually has nothing to do with the plist file itself. It's how Xcode (via the Property List Editor) presents the file.
You can test this by, in Finder, making a copy of a correctly-displaying plist file. Open the copy in the Property List Editor (usually the default application). The copy usually won't display the English names (until you change the Property List Type).
Xcode will remember the type you select and save it in the .xcodeproj file.

Localization of the iPhone Settings.bundle

For some reason I cannot get the Settings.bundle to recognize my additional languages. I must be missing something obvious, but I just cannot figure it out. Here's what I've got:
Project Structure in XCode:
Root.plist file:
Root.plist file http://img227.imageshack.us/img227/571/screenshot20100624at334.png
French Root.strings file
french Root.strings file http://img121.imageshack.us/img121/571/screenshot20100624at334.png
From everything I've read, I believe the project structure is right. The StringsTable in the Root.plist matches the name of the individual .strings files, and the Key for each item in the Root.plist has a match in the .strings files as well.
Why don't I see French text in my settings when I change the default iPhone language?
Thanks in advance!
For me, the problem was leaving off a semi-colon!
In localizable.strings, you get a runtime error if you omit the ";", but in Root.strings, you don't get any warnings, you can run it fine, but it just won't work!
So double-check to make sure you punctuate each key:value pair with a semi-colon!
I'll go ahead and answer my own question since I solved the problem myself through testing and failing. Hopefully this will help someone else in the future.
First, I think my Root.plist file may have been corrupted. I'm not exactly sure why, but I completely deleted the Settings.bundle, and re-created it to be sure.
Second, and perhaps most importantly, the main issue was the "key" in the root.strings file didn't match to the "key" field in the Root.plist, it actually matches the "Title" field.
Once I made those changes to the Root.strings file, it all started to work.
All you have to do is keep (or Add, if it's not there) "Strings Filename" in the Root.plist, after your settings.
Then, add Value "Root" (or, the name of your file and the translations) to make the created lang.lproj translations functional.
In my case, it appeared as if "Strings Filename" was set to "Root" in the Property List View of Root.plist, but when viewed the file in Source Code View, it was actually "StringsTable" pointing to "Root". The solution is to add another entry where "Strings Filename" points to "Root". (I also tried deleting the previous entry, but then it stops working, so you need both.)
In Xcode 5 there is still no obvious way to localize the Settings.bundle.
The problem
Xcode doesn't allow you to localize a file that is only shown because it is a file inside a folder that's directly shown in Xcode (hence the blue folder icons in the tree).
The Solution:
right-click the Root.strings file and select "Show in Finder"
List item
move the Root.strings file one folder up, so that the en.lproj folder is empty and the
Cmd-Drag the Root.strings file is next to the Root.plist.
delete the now empty en.lproj
go back to Xcode, notice that the tree will reflect the changes you now made
cmd-drag the file in the tree outside to outside the settings-bundle, so that it appears next to your source-code.
Do not copy the file
a dialog will appear asking you what to do with the file.
DO NOT select the checkbox to copy the file (you need this to be a reference)
DO NOT select a target to include the strings-file (the settings.bundle is already assigned to the correct target)
in the file inspector you can now choose to localize the file and to add languages to the localizations. The files will be placed correctly inside the settings.bundle and the tree will automatically reflect these changes, too.
After some repeated tries to activate localization,following steps worked for me:
Close xcode
Drag and duplicate the settings bundle onto the desktop (or wherever)
Open bundle contents
Drag Root.strings into
the en.lproj folder
Duplicate the en.lproj folder and rename to
whatever language you want (using 2-letter code ie fr.lproj)
Replace the original settings bundle with the new one(without
opening xcode).
Now Open xcode and the new files and folders
should be there
Now delete the older app and run xcode,Works fine in simulator and on device.
NOTE:Closing xcode,updating of duplicated setting bundle outside xcode and replacing updated back only will help.