Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //H
- @interface MonkeyViewController : UIViewController <UITableViewDelegate, UITableViewDataSource> {
- ...... tableview....
- }
- @end
- - (void)loadView {
- self.view = [[UIView alloc] initWithFrame:CGRectZero];
- self.view.backgroundColor = [UIColor redColor];
- // IT IS STILL WHITE
- self.tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStyleGrouped];
- self.tableView.delegate = self;
- self.tableView.dataSource = self;
- [self.view addSubview:[[UITableView alloc] initWithFrame:CGRectNull style:UITableViewStyleGrouped]];
- // This is where subclasses should create their custom view hierarchy if they aren't using a nib.
- //Should never be called directly.
- [super loadView];
- }
- AppDelegate
- MonkeyViewController *mvc = [[MonkeyViewController alloc] init];
- NSLog(@"%@", mvc.view);
- [window addSubview:mvc.view];
- [window makeKeyAndVisible];
Add Comment
Please, Sign In to add comment