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
PSListController: Difference between revisions - iPhone Development Wiki

PSListController: Difference between revisions

From iPhone Development Wiki
m (Move the occlass template down to the bottom, include the navbox.)
m (Added to Preferences category)
Line 16: Line 16:
@end
@end
</source>
</source>
{{occlass|library=Preferences.framework|navbox=1}}
{{occlass|library=Preferences.framework|navbox=1}}
[[Category:Preferences]]

Revision as of 23:49, 7 September 2014

PSListController is a class that represents a list of preferences in a table. It supports loading specifiers from a property list (specified at runtime).

Subclassing

This is a simple PSListController subclass that does not offer localization. The only message strictly required is -specifiers.

@interface MyListController : PSListController
@end
@implementation MyListController
- (id)specifiers {
    if(_specifiers == nil) {
        // Loads specifiers from Name.plist from the bundle we're a part of.
        _specifiers = [[self loadSpecifiersFromPlistName:@"Name" target:self] retain];
    }
    return _specifiers;
}
@end