IT tutorials
 
Mobile
 

iOS SDK : Application Settings - The Settings Bundle (part 2) - Settings Field Types

5/3/2013 9:01:42 PM
- How To Install Windows Server 2012 On VirtualBox
- How To Bypass Torrent Connection Blocking By Your ISP
- How To Install Actual Facebook App On Kindle Fire

1. Settings Field Types

You add preferences to the settings bundle through Root.plist. The different settings display differently in the Settings application. Possible values for settings are PSTextFieldSpecifier, PSTitleValueSpecifier, PSToggleSwitchSpecifier, PSMultiValueSpecifier, PSGroupSpecifier, and PSChildPaneSpecifier. This section considers each setting in turn.

PSGroupSpecifier

The PSGroupSpecifier groups settings into a group. If you have many settings, consider using this specifier to group your settings into logical groupings. Table 1 summarizes the PSGroupSpecifier’s settings.

Table 1. PSGroupSpecifier Settings
KeyPurposeTypeValid ValuesRequired
TypeSpecifies preference type.StringPSGroupSpecifierYes
TitleSpecifies the title displayed by Settings application.StringAny string valueYes

PSTextFieldSpecifier

The PSTextFieldSpecifier is for a preference whose value is a string. Table 2 summarizes a PSTextFieldSpecifier’s settings.

Table 2. PSTextFieldSpecifier Settings
KeyPurposeTypeValid ValuesRequired
TypeSpecifies preference type.StringPSTextFieldSpecifierYes
TitleSpecifies the title displayed by the Settings application.StringAny string valueYes
KeySpecifies the preference’s key used for storage and retrieval.StringAny string valueYes
Default ValueSpecifies a default value for the preference.StringAny string valueNo
IsSecureSpecifies if preference should be treated as password.BooleanYes or NoNo
KeyboardTypeSpecifies type of keyboard to display when tapped.StringAlphabet, NumbersAndPunctuation, NumberPad, URL, EmailAddress: default is AlphabetNo
AutoCapitalization TypeSpecifies if autocapitalization should occur.StringNone, Sentences, Words, AllCharacters; default is NoneNo
AutoCorrection TypeSpecifies if spelling should be automatically corrected.StringDefault, Yes, NoDefault

Try This: Adding a PSTextFieldSpecifier

  1. Open MySettings in Xcode. Open Root.plist in the Editor window.

  2. Expand PreferenceSpecifiers and delete Item 1, Item 2, and Item 3, leaving just Item 0.

  3. Select Item 0 and click the plus sign to its right. It adds a new row (Item 1). Note that this row is a child of PreferenceSpecifiers.

  4. Select Item 1 and change its type to Dictionary.

  5. Control-click Item 1, expand it, and select Add Row. A new child row should be added. Note that this row is a child of Item 1. Add two more new child rows; ensure that they are children of Item 1. Change each row to match Figure 5.

    Figure 5. Root.plist with PSTextFieldSpecifier
  6. Save the .plist file.

  7. Click Run. Navigate to Settings and MySettings settings. Click the text field, and your Simulator should match Figure 6.

    Figure 6. Settings reflecting the new setting

 
Others
 
- iOS SDK : Application Settings - The Settings Bundle (part 1)
- Ipad : Your Calendar - Calendar Options - Changing the Default Calendar
- Ipad : Your Calendar - Editing Appointments, Meeting Invitations
- BlackBerry Bold 9700 and 9650 Series : Email Set Up - BlackBerry Enterprise Server Express
- BlackBerry Bold 9700 and 9650 Series : Email Set Up - Set Up or Adjust Email Accounts from Your Computer
- BlackBerry Bold 9700 and 9650 Series : Email Set Up - Troubleshooting Your Email Accounts
- Windows Phone 7 : Building 2D Games with the XNA Framework (part 2) - AlienShooter Game Structure
- Windows Phone 7 : Building 2D Games with the XNA Framework (part 1)
- Android Application Development : Signing and Publishing Your Application (part 2)
- Android Application Development : Signing and Publishing Your Application (part 1)
 
 
Top 10
 
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
programming4us programming4us
 
Popular tags
 
Video Tutorail Microsoft Access Microsoft Excel Microsoft OneNote Microsoft PowerPoint Microsoft Project Microsoft Visio Microsoft Word Active Directory Biztalk Exchange Server Microsoft LynC Server Microsoft Dynamic Sharepoint Sql Server Windows Server 2008 Windows Server 2012 Windows 7 Windows 8 Adobe Indesign Adobe Flash Professional Dreamweaver Adobe Illustrator Adobe After Effects Adobe Photoshop Adobe Fireworks Adobe Flash Catalyst Corel Painter X CorelDRAW X5 CorelDraw 10 QuarkXPress 8 windows Phone 7 windows Phone 8 BlackBerry Android Ipad Iphone iOS