iphone - Group UITableView for Selection -
I have a UITableView in the group style, and I'm using it with the navigation controller. When a user clicks on the cell, I am encouraging another view to select a user, while all are working fine. I want the user to be brought back to the first scene, when the user selects. And I want to display their selection on the cell.
Thank you in advance for your help
. (UITableView *) tableView didSelectRowAtIndexPath: (NSIndexPath *) indexPath {NSString * selected (zero) tableView -
I think you can use NSUserDefaults
// Selecting the View Controller for ; If (indexPath.row == 0) {selected = @ "Apple"; } And if (indexPath.row == 1) {selected = @ "Microsoft"; } [[NSUserDefaults standardUserDefaults] setObject: selected forKey: @ "selected"]; [Self. Navigation Controller PopWebControllerUnited: Yes]; }
Important point you need to call [self.tableView reloadData] in view. DidAppear
// To show view controller what the user is selected - (zero) viewDidAppear: (BOOL) animated {[Superdudepiper: animated]; [Self.tableViewReloadData]; } - (UITableViewCell *) tableView: (UITableView *) tableView cellForRowAtIndexPath: (NSIndexPath *) indexPath {static NSString * CellIdentifier = @ "cell"; UITableViewCell * cell = [tableview] dequeueReusableCellWithIdentifier: CellIdentifier]; If (cell == blue) {cell = [[[UITBAL viacal light] Init with style: UITTualVeulesStyleValue1 resistorifier: cell identifier] AutoEques]; } // Configure Cell Cell.textLabel.text = @ "Choice"; Cell.detailTextLabel.text = [[NSUserDefaults standardUserDefaults] objectForKey: @ "selected"]; Return cell; }
Comments
Post a Comment