2011-10-16 13 views
0

設定ファイルで作業を開始したばかりで、設定バンドルでroot.plistを編集するとすぐに問題が発生しました。私のXCode 4は、plistにプロパティを追加するたびにクラッシュし、プロパティリストとして編集します。だから私は単純にソースコードとして編集すると思った。それはずっと簡単なようです。root.plistをソースコードとして編集するとplistが破損する

しかし、私がプログラムを実行すると、root.plistが読み込まれていません。 (デモプログラムの設定バンドルでうまくいきました。私はInAppSettingsKitを使用しています)ソースコードエディタでroot.plistを見て、正しく表示されました。私はそれをプロパティリストとして見ようとしましたが、plistが壊れているというエラーが表示されます。

ここは私のplistの内容です。誰かがそれに間違っていることを教えてもらえますか?

<?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> 
<!-- Databases --> 
     <dict> 
      <key>Title</key>    <string>Databases</string> 
      <key>Type</key>     <string>PSGroupSpecifier</string> 
     </dict> 
     <dict> 
      <key>Type</key>     <string>PSToggleSwitchSpecifier</string> 
      <key>Title</key>    <string>db0</string> 
      <key>Key</key>     <string>db0_preference</string> 
      <key>DefaultValue</key>   <true/> 
     </dict> 
     <dict> 
      <key>Type</key>     <string>PSToggleSwitchSpecifier</string> 
      <key>Title</key>    <string>db1</string> 
      <key>Key</key>     <string>db1_preference</string> 
      <key>DefaultValue</key>   <true/> 
     </dict> 
<!-- Sharing Actions --> 
     <dict> 
      <key>Type</key>     <string>PSGroupSpecifier</string> 
      <key>Title</key>    <string>Sharing Actions</string> 
     </dict> 
     <dict> 
      <key>Type</key>     <string>PSToggleSwitchSpecifier</string> 
      <key>Title</key>    <string>Facebook</string> 
      <key>Key</key>     <string>facebook_preference</string> 
      <key>DefaultValue</key>   <true/> 
     </dict> 
     <dict> 
      <key>Type</key>     <string>PSToggleSwitchSpecifier</string> 
      <key>Title</key>    <string>Twitter</string> 
      <key>Key</key>     <string>twitter_preference</string> 
      <key>DefaultValue</key>   <true/> 
     </dict> 
     <dict> 
      <key>Type</key>     <string>PSToggleSwitchSpecifier</string> 
      <key>Title</key>    <string>Email</string> 
      <key>Key</key>     <string>email_preference</string> 
      <key>DefaultValue</key>   <true/> 
     </dict> 
     <dict> 
      <key>Type</key>     <string>PSToggleSwitchSpecifier</string> 
      <key>Title</key>    <string>BlogSpot</string> 
      <key>Key</key>     <string>blogspot_preference</string> 
      <key>DefaultValue</key>   <true/> 
     </dict> 
<!-- Automatic Email Enable --> 
     <dict> 
      <key>Type</key>     <string>PSGroupSpecifier</string> 
      <key>Title</key>    <string>Automatic Emailing</string> 
     </dict> 
     <dict> 
      <key>Type</key>     <string>PSToggleSwitchSpecifier</string> 
      <key>Title</key>    <string>Always Send to Email</string> 
      <key>Key</key>     <string>autoblogspot_preference</string> 
      <key>DefaultValue</key>   <true/> 
     </dict> 
<!-- Calendar --> 
     <dict> 
      <key>Type</key>     <string>PSRadioGroupSpecifier</string> 
      <key>Title</key>    <string>First Day of the Week</string> 
      <key>Key</key>     <string>firstDayOfTheWeek_preference</string> 
      <key>Values</key> 
       <array> 
        <integer>0</integer> 
        <integer>1</integer> 
        <integer>2</integer> 
        <integer>3</integer> 
        <integer>4</integer> 
        <integer>5</integer> 
        <integer>6</integer> 
       </array> 
      <key>Titles</key> 
       <array> 
        <string>Sunday</string> 
        <string>Monday</string> 
        <string>Tuesday</string> 
        <string>Wednesday</string> 
        <string>Thursday</string> 
        <string>Friday</string> 
        <string>Saturday</string> 
       </array> 
     </dict> 
     <dict> 
      <key> 
    </array> 
    <key>StringsTable</key> 
    <string>Root</string> 
</dict> 
</plist> 

答えて

2

plistの最後には、ダングリングキーとdictタグがあります。

ライン#90と#91。

 </dict> 
     <dict /> 
    </array> 
    <key>StringsTable</key> 
    <string>Root</string> 
</dict> 
</plist> 

または

 </dict> 
     <dict> 
      <key>key</key><string>string</string> 
     </dict> 
    </array> 
    <key>StringsTable</key> 
    <string>Root</string> 
</dict> 
</plist> 

私はTextMateのを使用して、これを見つけた:

 </dict> 
     <dict> 
      <key> 
    </array> 
    <key>StringsTable</key> 
    <string>Root</string> 
</dict> 
</plist> 

のようなものであるべき。バンドル - >プロパティリスト - >構文の検証。正確な問題は教えてくれませんが、あなたをその地域に連れて行きます。

また、プロパティリストエディタアプリでPLISTを(/開発/アプリケーション/ユーティリティ/プロパティリストEditor.app)

プレースメントリストは、ので、任意のXMLです開こうとすることにより、見に行番号を取得することができますXMLバリデーターは、構文に大きな問題を見いだします。しかし、親指のルールは、あなたが近いタグを必要とするすべてのタグのためです。あらゆるキーについて、価値が必要です。 空のタグは<tag />でなく、<tag></tag>である必要があります。

+0

ありがとうございました。私はちょうど私がXMLをオンラインで検証することができたことに気づいた。それは同じことを示した。だから、それは神秘的なXcodeのことではありませんでした。 – Jim

関連する問題