i have a text held in my main view and a button next to textiew ,when i click the button it popup a popoverviewcontroler,in my popover controller view there is some text,in a tableview(high,low,medium,flair)i want when the user tap the high it needs to lot in the main textfield,but i tried nsuserdefault in the DiSelect row at index path.but nothing happen when i click the tableiew.how can i do this.
my code
NSString *strr = @"High";//i put the static value
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
[[NSUserDefaults standardUserDefaults] setObject:strr forKey:@"flair"];
[[NSUserDefaults standardUserDefaults] synchronize];
}
this code is in popoveriewconteroler
and in my main view
- (void)viewDidLoad
{
[super viewDidLoad];
NSString *strr = [[NSUserDefaults standardUserDefaults] objectForKey:@"flair"];
textfiled.text = strr;
}
when i go back to another page and comes back it lodes the high in the text filed.but i my red is when the user tap the popoveriewcontroller tableviewcell,it changes the text filed value at the same time.is this possible.
thanks in advance.
so you want to update the text label when user tap on a table cell?
not sure what your asking
but you can have a property for your popover controller
and a property for your main view controller
than in the place you create the popover controller
than you can replace
to