Ich habe eine benutzerdefinierte UITableView Cell, ich habe eine bestimmte Zelle ausgewählt und geht zu einem anderen ViewController, als ich zurück zum ersten View-Controller kam, ist der ausgewählte Zustand der Zelle nicht sichtbar. Wie werde ich den ausgewählten Zustand einer Zelle nach dem Navigieren von einem anderen ViewControllers unverändert beibehalten?Tabellenansicht Zelle ausgewählten Zustand ändert sich, wenn zu einem anderen Viewcontroller geht?
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return [timeSet count];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
timeSettingCell *newCell = nil;
newCell = [tableView dequeueReusableCellWithIdentifier:identifier];
if(newCell == nil)
{
NSLog(@"newCell ===================");
NSArray *nibViews = [[NSBundle mainBundle] loadNibNamed:@"timeSettingCell" owner:self options:nil];
newCell = [ nibViews lastObject];
}
newCell.timeLabel.text=[timeSet objectAtIndex:indexPath.row];
if (newCell.selected==YES) {
newCell.highlighted=YES;
newCell.timeImage.image=[UIImage imageNamed:@"radioSelected.png"];
}
else {
newCell.highlighted=NO;
newCell.timeImage.image=[UIImage imageNamed:@"radioNotSelected.png"];
}
return newCell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
value=[[time1 objectAtIndex:indexPath.row]integerValue];
SettingsViewController *settings=[[SettingsViewController alloc]initWithNibName:nil bundle:nil andCounterValue:value];
[[self presentingViewController] dismissModalViewControllerAnimated:YES];
index=indexPath.row;
[settings release];
}
-(void)viewWillAppear:(BOOL)animated{
}
danke
Wenn Sie quries benötigen, lassen Sie mich wissen .... –