简体   繁体   中英

Settings.bundle - plist: The data couldn’t be read because it isn’t in the correct format

I've used a script in Xcode 8 / iOS 10 to generate an acknowledge section in the settings bundle.

The script producing an Acknowledgements.plist file that gives the error message

The data couldn't be read because it isn't in the correct format.

when I try to open it in Xcode. When I open Acknowledgements.plist file with textEdit it looks OK on first sight ...

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PreferenceSpecifiers</key>
<array>
<key>Type</key>
<string>PSGroupSpecifier</string>
<key>FooterText</key>
<string>knobcontrol</string>
<key>Type</key>
<string>PSGroupSpecifier</string>
<key>FooterText</key>
<string>knobcontrol2</string>
</array>
<key>StringsTable</key>
<string>Acknowledgements</string>
</dict>
</plist>

I've tried some of the comments according to the script but could not find what is wrong with the plist - can anybody have a look at the file? I don't have enough reputation to post comments to the script posting.

You are using <key>...</key> value pairs within an <array> .

Make it a <dict> instead:

...
<plist version="1.0">
    <dict>
        <key>PreferenceSpecifiers</key>
        <dict>    <- dict, not array
            ...
        </dict>    <- dict, not array
        <key>StringsTable</key>
        <string>Acknowledgements</string>
    </dict>
</plist>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM