Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to enable iPhone Settings (bundle, plist) in MonoTouch

I'm trying to get the iPhone Settings working in a small test app I'm writing using MonoTouch/MonoDevelop. It's probably super basic/fundamental in Xcode...

...however I didn't immediately see how to do it in the MonoTouch examples, and after a bit of reading guessed that a Settings.bundle folder in the root of my MonoDevelop solution that contained a root.plist xml file should work.

It kinda did - my app now appears in the Settings window - but the actual inputs don't show up. I've tried a few different things in the plist (from google & Beginning iPhone Development book) but no luck so far.

Can someone point out what I've missed: either a step in the MonoTouch solution/build process or errors the format/content of my root.plist file?

<?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>Title</key>
    <string>iSOFlair</string>
    <key>StringsTable</key>
    <string>Root</string>
    <key>PreferenceSpecifiers</key>
    <array>
        <dict>
            <key>Type</key>
            <string>PSTextFieldSpecifier</string>
            <key>Title</key>
            <string>User Id</string>
            <key>Key</key>
            <string>soUserId</string>
            <key>AutocapitalizationType</key>
            <string>None</string>
            <key>AutocorrectionType</key>
            <string>No</string>
        </dict>
    </array>
</dict>
</plist>
like image 590
Conceptdev Avatar asked Aug 27 '09 12:08

Conceptdev


1 Answers

Okay I figured it out -- in addition to:

  1. Creating the Settings.bundle folder
  2. Creating the Root.plist in the correct format (ie including correct spelling!)

I also set the Build Action in MonoDevelop to 'Content' and the Copy to output directory to 'Always copy' to get the IDE to copy the plist TO THE DEVICE! Pretty obvious in hindsight.

I've posted screenshots of the steps and a working Root.plist file.

like image 187
Conceptdev Avatar answered Nov 18 '22 09:11

Conceptdev