Guest User

Untitled

a guest
May 25th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. //H
  2. @interface MonkeyViewController : UIViewController <UITableViewDelegate, UITableViewDataSource> {
  3. ...... tableview....
  4. }
  5. @end
  6.  
  7. - (void)loadView {
  8.  
  9. self.view = [[UIView alloc] initWithFrame:CGRectZero];
  10. self.view.backgroundColor = [UIColor redColor];
  11. // IT IS STILL WHITE
  12. self.tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStyleGrouped];
  13. self.tableView.delegate = self;
  14. self.tableView.dataSource = self;
  15. [self.view addSubview:[[UITableView alloc] initWithFrame:CGRectNull style:UITableViewStyleGrouped]];
  16. // This is where subclasses should create their custom view hierarchy if they aren't using a nib.
  17. //Should never be called directly.
  18.  
  19. [super loadView];
  20. }
  21.  
  22.  
  23.  
  24. AppDelegate
  25.  
  26. MonkeyViewController *mvc = [[MonkeyViewController alloc] init];
  27. NSLog(@"%@", mvc.view);
  28. [window addSubview:mvc.view];
  29. [window makeKeyAndVisible];
Add Comment
Please, Sign In to add comment