Domanda

I'm trying to achieve a nested structure of my App Settings by using pLists and Xcode 4.6.

What I've tried so far:

I did follow a tutorial from the Apple Documentation, here the link to the part where it comes to creating and additional settings page file.

I've added a Settings bundle with different items, which work perfectly. When it comes to my child pane, I have referenced a file by using the Filename "childsetting" and added a plist childsetting.plist by using the Finder to my Settings bundle.

The problem:

When I control-click my plist and choose "iPhone Settings plist" from the Property list type alternatives it won't accept my choice.

enter image description here

At first, everything looks fine:

enter image description here

But after clicking a different file and clicking back to my childsetting.plist, the Root element is still Root instead of "iPhone Settings Schema".

enter image description here

Editing the XML source, cleaning and building the project, restarting XCode or reinstalling the App didn't work. It always comes back to the same problem: the Childpane is empty. Looks like the pList doesn't get found - I guess because it isn't recognized as a iPhone Settings Schema.

È stato utile?

Soluzione

Appearently my pList got found, even though XCode didn't say "iPhone Settings Schema". My problem was that the values were not set properly. It is important to know that XCode fills in "shortcuts" for your values, but puts more specific values into the source XML. That's why you have to check out the documentation whether you use the correct identifier.

An example:

Adding a group element will be displayed with the value "Group". That does work if XCode recognises your pList as a settings schema.

enter image description here

If not, you have to use the value PSGroupSpecifier as described in the Documentation.

enter image description here

Furthermore it is important to put in all required values, elsewise your childpane will just not get displayed. So if you have any problems with your nested setting doesn't get displayed try following steps to fix it:

  1. Did you name the referenced pList the same as it is specified in your Childpane File specification without adding .plist?

  2. Did you move your referenced pList with the Finder to the Settings bundle?

  3. Did you check if your referenced elements use the exact values as descripted in the documentation (PSGroupSpecifier instead of Group)? This is especially important when XCode doesn't allow you to change the Property List Type...

  4. Are there any required elements which you didn't add to your Element? If yes, it won't get displayed...

  5. Do think you did everything right and it just doesn't get displayed? Delete the app from the device and clean build.

Altri suggerimenti

Neither of these solutions worked for me- what ended up being my problem was I had my File name as ChildPane.plist instead of just ChildPane. Turns out it is documented here as well.

Oh, I think I solved it. The File Type doesn't really affect the behavior of the settings app. I deleted my app from the device/simulator, then re-installed. Now the settings app shows the nested pages correctly, even the file type is not being as "iPhone settings plist" on the Xcode window.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top