84669 person learning
152542 person learning
20005 person learning
5487 person learning
7821 person learning
359900 person learning
3350 person learning
180660 person learning
48569 person learning
18603 person learning
40936 person learning
1549 person learning
1183 person learning
32909 person learning
class AAA ViewConntroller, UITableViewController后storyboard中TableViewController无法使用AAA这个类
但是我在storyboard中新添加ViewController容器后,在这个容器里再加入TableView就可以使用AAA这个类
这是什么原因?ViewConntroller, UITableViewController 不是并列的吗?
认证高级PHP讲师
UITableViewController is inherited from UIViewController and adds the two protocols <UITableViewDelegate, UITableViewDataSource> on the basis of inheritance. TBVC is a subcategory of VC, not a parallel relationship as you mentioned. Look at the code
NS_ASSUME_NONNULL_BEGIN NS_CLASS_AVAILABLE_IOS(2_0) @interface UITableViewController : UIViewController <UITableViewDelegate, UITableViewDataSource> - (instancetype)initWithStyle:(UITableViewStyle)style NS_DESIGNATED_INITIALIZER; - (instancetype)initWithNibName:(nullable NSString *)nibNameOrNil bundle:(nullable NSBundle *)nibBundleOrNil NS_DESIGNATED_INITIALIZER; - (nullable instancetype)initWithCoder:(NSCoder *)aDecoder NS_DESIGNATED_INITIALIZER; @property (nonatomic, strong, null_resettable) UITableView *tableView; @property (nonatomic) BOOL clearsSelectionOnViewWillAppear NS_AVAILABLE_IOS(3_2); // defaults to YES. If YES, any selection is cleared in viewWillAppear: @property (nonatomic, strong, nullable) UIRefreshControl *refreshControl NS_AVAILABLE_IOS(6_0) __TVOS_PROHIBITED; @end NS_ASSUME_NONNULL_END
UITableViewController is inherited from UIViewController and adds the two protocols <UITableViewDelegate, UITableViewDataSource> on the basis of inheritance. TBVC is a subcategory of VC, not a parallel relationship as you mentioned. Look at the code