@interface AViewController : UIViewController <UITextViewDelegate> {
@public
UITableView *tableView;
@private
NSUInteger someIndex;
}
@property (nonatomic, retain) ...
@end
@interface AViewController (AViewControllerCreation)
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil withController:(id)controller;
@end
@interface AViewController (AViewControllerMutator)
- (void) doSomeSettingStuff;
@end
@interface AViewController (AViewControllerAccessor)
- (NSString *)doSomeAccessorStuff;
@end
@interface AViewController (AViewControllerAction)
- (IBAction)cancel:(id)sender;
@end
@interface AViewController (AViewControllerTableViewDelegate) <UITableViewDelegate, UITableViewDataSource>
@end
你可以在NSButton、NSControl等中看到这种设置界面的风格。有趣的是,相应的类别如UIButton、UIControl并没有使用这种惯用语法。嗯,这些可能是后来才出现的,因为我认为UIKit是在AppKit之后完成的。那么这个惯用语法是“老掉牙”的吗?除了风格外,还有其他原因吗?它是好的风格还是坏的风格?有没有文档介绍这个?谢谢大家。