Empty Settings Bundle in Xcode 4.2

前端 未结 4 1059
一向
一向 2020-12-09 14:49

I\'m trying to create a settings bundle for my iPhone application.

However, if I create one, it becomes empty, no root p-list, no disclosure, nothing.

I\'ve

相关标签:
4条回答
  • 2020-12-09 15:23

    For XCode 5.1, I had a similar problem. Using "File/Open" in XCode to open Settings.bundle just showed an empty window, with no way to open Root.plist . Right clicking on Settings.bundle in XCode File/Open did not reveal any useful options.

    The solution is to find the Settings.bundle in Finder, right-click and select "Show Package Contents", and you will see Root.plist. Just right-click on Root.plist, select XCode from the list of programs, and you will get XCode's Settings editor.

    0 讨论(0)
  • 2020-12-09 15:36

    Click on the Settings.bundle file in the left window -> From main menu choose View -> Utilities -> Show FileInspector. Then change fileType to "applicationBundle" = the two missing files will show again under the Settings.bundle.

    0 讨论(0)
  • 2020-12-09 15:42

    I'm having exactly the same problem. It seems there's a bug in XCode4. Here's what I did that gets you a Settings bundle at least.

    (1) In XCode, select CMD+N to add a new file.

    (2) From the drop-down, select Resource (as per the 'instructions' that don't work).

    (3) Instead of selecting 'Settings.bundle' - select 'Property List'.

    (4) Name your property list Root.plist and save it in a new directory called 'Settings'.

    (5) Now CMD+N again and select Strings File.

    (6) Call the new strings file 'Root.strings' and save that in the 'Settings' directory as well.

    (7) Now, in your directories and files list on the left, highlight both of the new files and press delete (TRUST ME HERE!).

    (8) On the delete menu, select 'Remove References Only'.

    (9) Now go to Finder and rename the 'Settings' directory to 'Settings.bundle'

    (10) In XCode again, ALT+CMD+A to add a new file to your project and select the 'Settings.bundle' object from the navigator.

    You will now have a working 'Settings.bundle' BUT the two files will be uninitiated, so you'll have to build them yourself from scratch.

    This has worked for me twice now and hopefully, this bug will be fixed in the next maintenance release of XCode4. Hope this helps. V.V.

    0 讨论(0)
  • 2020-12-09 15:46

    For those that can't change the filetype, because it doesn't appear, follow these steps:

    1. Go to your project directory in finder.
    2. Create a folder called "Settings."
    3. Open Text Edit (or any other text editor for that matter)
    4. Type in:

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"   "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
      <!--
         Root.plist
         Preference settings for MyApp
      -->
      <plist version="1.0">
          <dict>
      
          </dict>
      </plist>
      

      4a. Change "MyApp" to your app-name

    5. Save as "Root" in the settings folder
    6. Rename the file to "Root.plist"
    7. Rename the "Settings." Folder to "Settings.bundle"
    8. Add the "Settings.bundle" file to Xcode and you should be good to go :)
    0 讨论(0)
提交回复
热议问题