views:

27

answers:

0

I am trying to add cell to a table view dynamically I have a textfield and a button so far i can add a field statically. this is my code for that

(void)viewDidLoad {
  [super viewDidLoad];
  tableList = [[NSMutableArray alloc] init];

  [tableList addObject:@"Kevin"];
  [tableList addObject:@"Carlo"];
  [self setTitle:@"The Alcoholics"];

  // Uncomment the following line to display an Edit button 
  //in the navigation bar for this view controller.
  //self.navigationItem.rightBarButtonItem = self.editButtonItem;
}

i want to make it dynamically

(void) buttonClick: (id) sender{
  tableList = [[NSMutableArray alloc] init];

  [tableList addObject:textField3];
}