I have created programme in which we navigate from table view to a simple view on selecting a row of table view.And I have made four checkbox on simple view.We can mark them easily.Then we store the information corresponding to the marked checked box in string.And I want to access this string in table view to show it on cell.I am not getting it using object
3 Answers
One common way to do this is to store a reference to your tableview controller in a property on your simple (detail) view controller. You would set the value of this property when your instantiate and push the simple view controller onto the navigation stack. After the checkboxes are marked, save the string to a property on the tableview controller before navigating back to the tableview.
Roughly, your code would look something like this:
In your table view controller .h:
@property (strong, nonatomic) NSString *checkBoxValue;
In your table view controller .m:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
SimpleViewController *simpleVC = [[SimpleViewController alloc] init];
simpleVC.tableViewController = self;
[self.navigationController pushViewController:simpleVC animated:YES];
}
In your simple view controller .h:
@property (strong, nonatomic) YourTableViewController *tableViewController;
In your simple view controller .m:
// after checkboxes are selected...
self.tableViewController.checkBoxValue = @"Value goes here";
Then when you navigate back to the table view controller you can do whatever you need to with the value in the checkboxValue
property.

- 15,682
- 4
- 50
- 43
You should use delegate method. It is commonly used pattern in Objective-C in this scenario. I have answered with an example in this SO. Let me know if you still have question afterward.

- 1
- 1

- 14,323
- 10
- 62
- 102
You can use custom delegate for this .Make a delegate in the second class.And when you again come to first class the delegate methode will be automatically called,don't forget to implement delegate in first class.

- 1,510
- 1
- 21
- 48