Guest User

Untitled

a guest
Oct 14th, 2014
330
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. - (void)viewDidLoad
  2. {
  3.     [super viewDidLoad];
  4.     if (!self.tableView){
  5.         self.tableView = [[UITableView alloc] initWithFrame:self.view.bounds
  6.                                                       style:self.tableViewStyle];
  7.         self.tableView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
  8.     }
  9.     if (!self.tableView.superview){
  10.         [self.view addSubview:self.tableView];;
  11.     }
  12.     if (!self.tableView.delegate){
  13.         self.tableView.delegate = self;
  14.     }
  15.     if (!self.tableView.dataSource){
  16.         self.tableView.dataSource = self;
  17.     }
  18.     if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0")){
  19.         self.tableView.rowHeight = UITableViewAutomaticDimension;
  20.         self.tableView.estimatedRowHeight = 44.0;
  21.     }
  22.     if (self.form.title){
  23.         self.title = self.form.title;
  24.     }
  25.     [self.tableView setEditing:YES animated:NO];
  26.     self.tableView.allowsSelectionDuringEditing = YES;
  27.     self.form.delegate = self;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment