0

I am making a UITableView by inheriting UITableViewControll as below

 @interface addAlarm : UITableViewController <UITableViewDataSource>

then I have populating some data in its cells from delegate, as below

  if (indexPath.row == 0) {    
        AlarmProjectAppDelegate *delegate = (AlarmProjectAppDelegate *)[[UIApplication sharedApplication] delegate];

    NSString *cellValue = [NSString stringWithFormat:@"Name"];
    cell.textLabel.text = cellValue;
    return cell;

then I go to other controller as

              Name *ob = [[Name alloc] initWithStyle:UITableViewStyleGrouped];
        [self.navigationController pushViewController:ob animated:YES];

        [ob release];
        ob = nil; 

as There will be a back button and as I do click that it will be poped and come back on current Class "addAlarm"

but I saw that when it come back, then below method is not being called not even viewDidLoad, so table is refreshing it's data,

  - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath

I used [self.tableView reloadData]; in viewWillApear, but it won't work and won't call above method

what should I do to solve this problem, if you are not able to understand the question, you may ask again to me in comments,

Thanks in Advance

Chatar Veer Suthar
  • 15,541
  • 26
  • 90
  • 154

1 Answers1

1

It is due to you are passing name value in dealloc method. So it is called after viewWillAppear of another view. So that is why your tableview is not being reloaded.

Try to send value in viewWillDisappear method.

Deeps
  • 4,399
  • 1
  • 26
  • 27