(A little more documentation.) |
m (Unnecessary change inconsistent with standard) |
||
(4 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
'''PSListController''' is a class that represents a list of preferences in a table. It supports loading [[PSSpecifier|specifiers]] from a property list (specified at runtime). | '''PSListController''' is a class that represents a list of preferences in a table. It supports loading [[PSSpecifier|specifiers]] from a property list (specified at runtime). | ||
==Subclassing== | == Subclassing == | ||
This is a simple PSListController subclass that does not offer localization. The only message strictly required is -specifiers. | This is a simple PSListController subclass that does not offer localization. The only message strictly required is -specifiers. | ||
<source lang="objc"> | <source lang="objc"> | ||
@interface MyListController : PSListController | @interface MyListController : PSListController | ||
Line 13: | Line 14: | ||
_specifiers = [[self loadSpecifiersFromPlistName:@"Name" target:self] retain]; | _specifiers = [[self loadSpecifiersFromPlistName:@"Name" target:self] retain]; | ||
} | } | ||
return _specifiers | return _specifiers; | ||
} | } | ||
@end | @end | ||
</source> | </source> | ||
{{occlass|library=Preferences.framework|navbox=1}} | |||
[[Category:Preferences]] |
Latest revision as of 02:50, 11 April 2016
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
|