NameSubViewController
并NameSubView
添加到ViewController.m
:
#import "NameSubViewController.h"
#import "NameSubView.h"
...
- (void)viewDidLoad
{
[super viewDidLoad];
NameSubViewController *nameController = [[NameSubViewController alloc] initWithNibName:@"NameSubViewController" bundle:nil];
NameSubView *nameSubView = (NameSubView *)[nameController view];
}
但我想为它们创建属性,以便我可以从视图的每个部分访问它们。写什么ViewController.h
来声明那里的属性?