0

I have a UIViewController that contains a text field, date field and a button. In addition I have a UITableViewController that has a Mutablearray. How can I pass the values from my text field and date field to create a new item in the Mutablearray in the other class?

Edit: My UIViewController where the the text and date fields are is empty (Kinda need help here). and my UITableViewController is below:

@interface TableView ()
@end

@implementation TableView
 - (void)viewDidLoad
{
   [super viewDidLoad];
    items = [[NSMutableArray alloc] initWithObjects:@"one", @"two", @"three", @"four", nil];



}


- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
return items.count;
}

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
   UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"TodoItemRow"];
   cell.textLabel.text= [items objectAtIndex:indexPath.row];
   return cell;
  }

  - (void)didReceiveMemoryWarning
  {
   [super didReceiveMemoryWarning];

   }


   @end
Hermann Klecker
  • 14,039
  • 5
  • 48
  • 71
John Don
  • 11
  • 4

0 Answers0