title: how to maintain the checkbox state after navigating from one ViewController to another ios
body: <p>i have a table view and i places button on a tableview as a checkbox ,now i want to maintain state of checkbox's .my problem is when i am navigate from one view controller to another OR  terminating my application all checkbox's are unchecked which was previously checked. any suggestion appreciable.</p>
  
  <pre><code>- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
  {
      NSString *str=[NSString stringWithFormat:@"identfier%d",indexPath.row];
      UITableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:str];
  
      UILabel *lblValue;
      if (cell==nil) {
          cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:str];
  
          lblValue=[[UILabel alloc]init ];
  
          lblValue.tag=indexPath.row+20000;
          btnValue=[UIButton buttonWithType:UIButtonTypeRoundedRect];
  
          btnValue.tag=indexPath.row+100;
      }else{
         lblValue=(UILabel*)[cell.contentView viewWithTag:indexPath.row+20000];
         btnValue=(UIButton*)[cell.contentView viewWithTag:indexPath.row+100];
  
      }
  
      lblValue.backgroundColor=[UIColor clearColor];
      lblValue.text=[[sortedArray objectAtIndex:indexPath.row]valueForKey:@"CategoryName"];
      //lblValue.text=@"some value";
  
      UIImage *buttonImage = [UIImage imageNamed:@"radiou.png"];
      UIImage *buttonImage1=[UIImage imageNamed:@"radioc.png"];
      [btnValue setBackgroundImage:buttonImage forState:UIControlStateNormal];
      [btnValue setBackgroundImage:buttonImage1 forState:UIControlStateSelected];
  
  
      [btnValue addTarget:self action:@selector(checkedButton:) forControlEvents:UIControlEventTouchUpInside];
      btnValue.frame=CGRectMake(10, 15, 25, 25);
  
      if([self.navigationItem.rightBarButtonItem.title isEqual:@"Done"]){
          [UITableView animateWithDuration:0.3f delay:0.1f options:UIViewAnimationOptionCurveEaseInOut animations:^{
              lblValue.frame=CGRectMake(35+25, 17, 200, 20);
             btnValue.hidden=NO;
  
          } completion:nil];  
      }
      else
      {
          [UITableView animateWithDuration:0.3f delay:0.1f options:UIViewAnimationOptionCurveEaseInOut animations:^{
               lblValue.frame=CGRectMake(35, 17, 200, 20);
  
              btnValue.hidden=YES;
          } completion:nil];
  
      }
      [cell.contentView addSubview:btnValue];
      [cell.contentView addSubview:lblValue];
  
      return  cell;
  }
  </code></pre>