Dev:PreferenceBundles

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&times;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  method and return it. This is because PSListController relies on _specifiers</tt> to generate specifier metadata and group indices since iOS 4.0. Example:

Using a Preference Bundle
It is very common to load preferences in the constructor of your tweak.

It is very important to only load the preferences in the constructor and not access or modify any UI elements. If you need to do this, you can load your preferences in SpringBoard's init method.

More information about preferences can be seen here.