【发布时间】:2010-12-25 22:47:24
【问题描述】:
当我尝试弹出视图控制器时,它不会更新前一个视图的信息。示例:我有一个单元格在 View1 的标签中显示文本。当您单击单元格时,它会转到 View2(例如)当我在 View2 中选择一个选项时,popViewControllerAnimated 用于返回到 View1,但是,我希望现在使用 View1 中的新选项更新标签。
我的困境是当我弹出 View2 时,View1 中的标签不会更新。有任何想法吗?我试过添加 [view1 reloadData];在视图弹出之前,但没有运气。
//VIEW1 the cell that displays the label.
ringLabel = [[UILabel alloc] initWithFrame: CGRectMake(25, 12.7f, 250, 20)];
ringLabel.adjustsFontSizeToFitWidth = YES;
ringLabel.textColor = [UIColor blackColor];
ringLabel.font = [UIFont systemFontOfSize:17.0];
ringLabel.backgroundColor = [UIColor clearColor];
ringLabel.textAlignment = UITextAlignmentLeft;
ringLabel.tag = 0;
ringLabel.text = [plistDict objectForKey:@"MYOPTION"];
[ringLabel setEnabled:YES];
[cell addSubview: ringLabel];
[ringLabel release];
//VIEW2 when cell clicked
CustomProfileViewController *cpvc = [CustomProfileViewController alloc];
cpvc.ringtone = [ringList objectAtIndex:indexPath.row];
[cpvc.tblCustomTable reloadData];
[self.navigationController popViewControllerAnimated:YES];
【问题讨论】:
标签: iphone uitableview ios uiview