(Removed PSTitleValueCell recipe) |
(Extended description, removed entry plist and directed towards that section on PreferenceLoader, formatting) |
||
Line 1: | Line 1: | ||
'''Preference Bundles''' are bundles for extending the [[Preferences.app|Settings]] application. | '''Preference Bundles''' are bundles for extending the [[Preferences.app|Settings]] application. Developers can build their own bundles and place them in <tt>/Library/PreferenceBundles/</tt> for others to use. | ||
== Structure of a Preference Bundle == | == Structure of a Preference Bundle == | ||
For more information, see [[Preferences_specifier_plist|Preferences Specifier Plist Format]]. | Preference bundles must have the extension <tt>.bundle</tt>. The principle class of the bundle should be a subclass of [[PSListController]] or [[PSViewController]]. When providing localization files, if a specifier plist is called <tt>spec.plist</tt>, there should be a corresponding localization file called <tt>spec.strings</tt>. The bundle can have a 29×29 icon, with a preferred name of <tt>icon.png</tt>. | ||
For more information on specifiers, see [[Preferences_specifier_plist|Preferences Specifier Plist Format]]. | |||
== Issues with OS 3.2 and 4.0 == | == Issues with OS 3.2 and 4.0 == | ||
Line 10: | Line 11: | ||
<tt>PSViewController</tt> underwent a massive change after 3.1, breaking all custom subclasses on the iPad and on 4.0 - it is now a UIViewController. | <tt>PSViewController</tt> underwent a massive change after 3.1, breaking all custom subclasses on the iPad and on 4.0 - it is now a UIViewController. | ||
Improper implementations of <tt>PSListController</tt> subclasses will fail to work properly on 4.0. You must set <tt>_specifiers</tt> within the < | Improper implementations of <tt>PSListController</tt> subclasses will fail to work properly on 4.0 and later. You must set <tt>_specifiers</tt> within the <code>- (id)specifiers</code> method and return it. This is because PSListController relies on <tt>_specifiers</tt> to generate specifier metadata and group indices since iOS 4.0. Example: | ||
<source lang="objc"> | <source lang="objc"> | ||
- (id) specifiers { | - (id)specifiers { | ||
if (!_specifiers){ | if (!_specifiers){ | ||
_specifiers = [[self loadSpecifiersFromPlistName: kNameOfPreferencesPlist target: self] retain]; | _specifiers = [[self loadSpecifiersFromPlistName: kNameOfPreferencesPlist target: self] retain]; | ||
} | } | ||
return _specifiers; | return _specifiers; | ||
} | } | ||
</source> | </source> | ||
== | == Using a Preference Bundle == | ||
{{main|PreferenceLoader}} | {{main|PreferenceLoader#PreferenceBundle_Approach}} | ||
== 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. | ||
{{Navbox Library}} | {{Navbox Library}} | ||
[[Category:Directories in /System/Library]] | [[Category:Directories in /System/Library]] |
Revision as of 06:16, 1 August 2014
Preference Bundles are bundles for extending the Settings application. Developers can build their own bundles and place them in /Library/PreferenceBundles/ for others to use.
Structure of a Preference Bundle
Preference bundles must have the extension .bundle. The principle class of the bundle should be a subclass of PSListController or PSViewController. When providing localization files, 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.
For more information on specifiers, see Preferences Specifier Plist Format.
Issues with OS 3.2 and 4.0
PSViewController underwent a massive change after 3.1, breaking all custom subclasses on the iPad and on 4.0 - it is now a UIViewController.
Improper implementations of PSListController subclasses will fail to work properly on 4.0 and later. You must set _specifiers within the - (id)specifiers
method and return it. This is because PSListController relies on _specifiers to generate specifier metadata and group indices since iOS 4.0. Example:
- (id)specifiers {
if (!_specifiers){
_specifiers = [[self loadSpecifiersFromPlistName: kNameOfPreferencesPlist target: self] retain];
}
return _specifiers;
}
Using a Preference Bundle
References
- iPhone Settings Within Settings.app, by Skylar Cantu.
|