8

I've added a Settings.bundle, however while displaying version numbers I'd like the fields to be read-only.

I've seen a few suggestions that say to change the type from text to title, but when I do this, the settings entry isn't displayed.

enter image description here

VaporwareWolf
  • 10,143
  • 10
  • 54
  • 80

3 Answers3

9
        <array>    
            <dict>
                <key>Type</key>
                <string>PSGroupSpecifier</string>
                <key>Title</key>
                <string>version</string>
            </dict>
            <dict>
                <key>DefaultValue</key>
                <string>1.1</string>
                <key>Key</key>
                <string>version</string>
                <key>Title</key>
                <string>version</string>
                <key>Type</key>
                <string>PSTitleValueSpecifier</string>
            </dict>
        </array>

I am able to add readonly variable 'Version' with the above dictionary in root.plist. Have you set using Title specifier ?? Or Try adding above dict. in your root.plist , this will add readonly title in your settings in group style.

adamdehaven
  • 5,890
  • 10
  • 61
  • 84
iCoder
  • 1,298
  • 1
  • 9
  • 25
  • Okay, I pasted that code in and it works. So what was the big difference between your snippet and what I had done? Afterall I changed the type from Text to Title, but that made the setting disappear. The difference was that you have DefaultValue included. It still reads the value from NSUserDefaults just fine. But the answer is that if you change to Title, you must have the DefaultValue field included. – VaporwareWolf Apr 16 '13 at 16:53
5

To display Title property in the Settings.bundle you need also to add "Default Value" (it could be empty).

Check the answer here: https://stackoverflow.com/a/22712746/1757229

Community
  • 1
  • 1
sash
  • 8,423
  • 5
  • 63
  • 74
0

you need to change your type from PSTextFieldSpecifier to PSTitleValueSpecifier.

  • Welcome to StackOverflow! Please provide a specific answer backed with references. If you have a suggestion or need clarification leave a comment. We have guidelines on [How to write a good answer](https://stackoverflow.com/help/how-to-answer). – Joseph Cho Nov 15 '18 at 19:16