From iPhone Development Wiki
Revision as of 02:58, 11 April 2016 by Uroboro (talk | contribs) (Unnecessary change inconsistent with standard)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

PSDetailController is a view controller controlling a custom editing pane.

Detail controller in Specifier plist

PSDetailController is in fact a misnomer, because the detail key in the preferences specifier plist can be any PSViewController (usually a subclass of PSListController). Actually, the only requirement of the detail key is the class must adopt the informal protocol

@protocol PSDetailController <PSViewController>

The detail controller class will be sent a +validateSpecifier: message if one exists right after the bundle is lazy-loaded:

@implementation PSRootController
-(void)lazyLoadBundle:(PSSpecifier*)srcSpecifier {
        if ([srcSpecifier->detailControllerClass respondsToSelector:@selector(validateSpecifier:)])
                [srcSpecifier->detailControllerClass validateSpecifier:srcSpecifier];

Whenever a view becomes visible, a detail controller class instance will be allocated with -initForContentSize:, and then call -viewWillBecomeVisible: to notify that the view becomes visibile. There is also some other calls to the controller but you'd better leave them untouched.

id<PSDetailController> detailController = [[[spec->detailControllerClass alloc]
detailController.rootController = _parentController.rootController;
detailController.parentController = _parentController;
[detailController viewWillBecomeVisible:spec];

External links