Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/html/extensions/Variables/includes/ExtVariables.php on line 198

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/html/extensions/Variables/includes/ExtVariables.php on line 198

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/html/extensions/Variables/includes/ExtVariables.php on line 198

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/html/extensions/Variables/includes/ExtVariables.php on line 198
PreferenceBundles: Difference between revisions - iPhone Development Wiki

PreferenceBundles: Difference between revisions

From iPhone Development Wiki
mNo edit summary
(Added on how to use the PSTitleValueCell)
Line 14: Line 14:
   label = "Description of the setting";
   label = "Description of the setting";
  };
  };
== Cell Types ==
Displaying a value with PSTitleValueCell like Preferences -> General -> About
Add the cell to your plist:
        {
            cell = PSTitleValueCell;
            get = "valueForSpecifier:";
            label = Version;
        },
Add the getter method to your controller:
- (NSString *) valueForSpecifier: (PSSpecifier *) specifier {
return @"1.0";
}


== References ==
== References ==
* [http://www.touchrepo.com/guides/preferencebundles/PreferenceBundles.doc iPhone Settings Within Settings.app], by Skylar Cantu.
* [http://www.touchrepo.com/guides/preferencebundles/PreferenceBundles.doc iPhone Settings Within Settings.app], by Skylar Cantu.
 
* [http://code.google.com/p/networkpx/wiki/PreferencesSpecifierPlistFormat PreferencesSpecifierPlistFormat], by kennytm
{{Navbox Library}}
{{Navbox Library}}
[[Category:Directories in /System/Library]]
[[Category:Directories in /System/Library]]

Revision as of 19:38, 29 October 2009

Preference Bundles are bundles for extending the Settings application.

Structure of a Preference Bundle

Preference bundles should have an extension of .bundle. The principle class of the bundle should be a subclass of PSListController. Most of the time there are lots of preference specifier plists which defines a page of setting. If a specifier plist is called spec.plist, there should be a corresponding localization file called spec.strings. The bundle can have a 29×29 icon, with a preferred name of icon.png.

Adding a Preference Bundle

To add a preference bundle foo.bundle to the front page of the Settings application, save this as a plist in /Library/PreferenceLoader/Preferences/:

entry = {
  bundle = foo;
  cell = PSLinkCell;
  icon = icon.png;
  isController = 1;
  label = "Description of the setting";
};

Cell Types

Displaying a value with PSTitleValueCell like Preferences -> General -> About Add the cell to your plist:

        {
           cell = PSTitleValueCell;
           get = "valueForSpecifier:";
           label = Version;
       },

Add the getter method to your controller: - (NSString *) valueForSpecifier: (PSSpecifier *) specifier {

return @"1.0"; }


References