Why can't I add a child pane plist file into my project's Settings.bundle? - iphone

I'm running Xcode 4.1 and I've been following a tutorial about app settings. Everything has been going great up until I get ready to add a plist for a child pane that I want to add.
The video tutorial I'm watching (also using Xcode 4.1) shows the guy right-clicking the settings.bundle and choosing Add File... and then saving a file named More. In the video tutorial, he ends up with a More.plist showing up in the project and also in the settings.bundle right in the same level with the Root.plist. I just get it in the project. Nothing in the settings.bundle, and I can't figure out how to copy it there.
I've also noticed that in the tutorial, in the Project Navigator, the settings.bundle has an icon that looks kind of like an outline of a shield. In my Project Navigator, the settings.bundle looks like a white sheet of paper with a corner folded down.
Anyone know what the heck is going on?
FWIW, the root app settings works fine in the simulator. I can see the stuff I set up just fine. I can click on the link to my child pane and it switches to it, but nothing that I added in the more.plist shows up there.
Any help GREATLY appreciated!!

Argh, Apple tends to change things without letting anyone know. The whole settings bundle thing is just not well integrated into XCode if you ask me.
If you ever try to localize your application, you will find that you have to manually add the localization folders to the settings.bundle.
Looks like we have to do the same thing to add child menus now, as just adding the plist file does not put it into the settings.bundle.
Here is the set of steps I just tried that worked.
Open up finder, you can right click or two finger click Settings.bundle and choose "Show in Finder".
Right click Settings.bundle in the finder window, choose show package contents.
Copy the new plist file into this the settings.bundle next to the Root.plist
Delete the new plist from the main project.

I was not able to get the text field to show up under additional .plist page.
My Fix:
Leave only 1 Child.plist file outside Settings.bundle
Navigate to Root.plist
Right click and select 'Show Ray Keys/Values'
Right click and select 'Add Row'. Add:
Key: File
Type: String
Value: Root

In Xcode 4.3.2,
Right click the Project Name in the Project Navigator, and choose Show in Finder.
In Finder, right click the setting.bundle and choose Show Package Contents.
Copy the new .plist to setting.bundle.
Back to XCode, open the setting.bundle, wilfully add one item under the Preference Items, then expand it and modify the value of Type to Child Pane.I can't upload the image, so give the link of the blog.

This problem still exists in Xcode 4.2. Creating and moving [child].plist in Finder does help thanks to John S up there.
Some additional tips.
Make sure to turn on "Show Raw Keys/Values" by right clicking inside the opened root.plist file for the "ChildPane Type" to appear. Also make sure to select "Property List Type" as "iPhone Settings plist". If you're having trouble with ordering items, just open the plist file in a text editor and move the xml elements around accordingly.

Additional additional tip: in Xcode 4.2 to explore/expand the contents of the bundle make sure to set its type to Application Bundle (via File Inspector Menu).

Same issue, waste my almost 1 hour.
1st make sure your plist format is correct.
My solution:
Delete you bundle, and re-build & run.
Now everything is fine...

Related

Xcode Base internationalization doesn't work

I'm trying to localize my app.
I noticed that if I add a language every localized file become doubled.
In this way it's impossible to maintain code or storyboard so I learnt that I need Base internationalization.
The problem is that when I select that checkbox in xcode project setting it shows a window without nothing to select, does anyone know how to fix this?
Here's a screenshot
First, you need to go to your storyboard file, open the bar on the right side, and go to Show the File Inspector, the furthest tab to the left. Then, scroll down and click localize. After this, when you check Use Base Localization, you should see the storyboard appear.
This could happen if Base Internationalization was active before then disabled and files deleted manually.
Create Base.lproj folder in your project folder using the finder.
Move your main story board to it also using the finder.
fix the reference to it from Xcode.
remove app. from device, clean & build your project.
All will be back to normal.

Settings bundle - New items not showing up in Xcode

I am a newbie to iOS Development. Learnt a chapter 2 days back about using settings bundle in my apps. The tutorial also showed me how to add new plist files and images into the settings bundle by ctrl+click opening the bundle in Finder.
But the newly added items do not show up in Xcode project organizer list. Is that how it works or do we have an alternative?
[Update at 1:53PM EST by Deepu]
Thank you guys for the replies. Actually I figured out something weird. When I added objects to the settings bundle from Finder, they did not initially show up on Xcode. I closed everything and then reopened Xcode and saw them in the bundle inside Xcode. So I guess the error was on my part expecting the objects to be added in Xcode as soon as I added them to the File system via Finder.
Sorry for the trouble and thanks for the advises.
It has to be there maybe inside any folder. When I add a file I usually add first a group (right click Add group) then there is a new folder so in the folder (example images) I right click and add a file.
It should be there, if not then right click on any folder/file in your xcode, tap on Show or Reveal in Finder, then it will take you to a place where all of your project files are placed, drag and drop from there into your project. It will not automatically pull into your project if you will add them in a folder on your disk. You will have to drag and drop into your project.
Let me know if you have any questions.
Reno Jones

How to add bundles and resources like images in that bundle in iPhone

I created bundle using i-phone-OS->resources->setting but I am unable to add images to this bundle. I tried dragging images folder or by adding existing to folder but nothing works.
Thanks in advance
The Settings.bundle is added as a folder/bundle reference and not as a group.
Thus you won't be able to easily add some content to it right from the Groups & Files panel in Xcode unfortunately. Instead, go in the Finder, right-click (or ctrl-click) on this Settings.bundle and select "Show Package Contents" then drag & drop files in there. You will then find the added files back in Xcode.
I also find this kinda anoying in Xcode3 that we can't add files to '.bundle' folders/bundles directly from Xcode3 :( But AFAIK there is no other solution
One your file has been added to the '.bundle', you can edit them directly from Xcode. (Going thru the Finder is only necessary for adding new files to it)

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.

iPhone simulator isn't showing splash screen

All I have to do to show a splash screen in a view-based application is drag an image into the resources folder and name it default.png, correct? This is what I did, but the image doesn't show.
When you added it, did you tell it to copy to output location? It was a checkbox on the dialog that showed up after you added it. Try readding and make sure this checkbox is checked.
UPDATE from comments: a clean build fixed the problem
It sounds like what you are doing is correct, but reading through the documentation might help you work out what the problem is.
Perhaps your Default.png is not in the root of your bundle? To check, expand the Products section in the Groups & Files panel, then select Reveal in Finder from the context menu. Then right click on the app bundle in Finder, and select Show Package Contents. You should see your Default.png listed there.