【发布时间】:2012-12-24 18:45:56
【问题描述】:
如何从UIView 重新加载UIVIewcontroller 的数据。实际上我有一个UIVIewController,它的自定义类类为UIView。现在在UIViewcontroller 我有一个标签,我需要打印在UIView 中定义的标签值。
但是UIViewController的viewdidload首先被编译然后编译器移动到UIView。那么我该如何打印或重新加载UIVIewController
。 UILabel Text 我已经在UIViewController 的ViewDidLoad 中定义了,值取自UIView 类
那么我该如何重新加载UIViewController。
我正在做的是:
UIVIewController(thirdTab) 类
-(void)viewDidLoad{
[self reloadInputViews1];
}
-(void)reloadInputViews1{
appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
// labelPrint.text=appDelegate.dayPrint;
[self.labelPrint setText:labelPrint.text];
}
UIView 类
- (void)drawRect:(CGRect)rect {
AppDelegate* appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
appDelegate.dayPrint=theDate;
NSLog(@"appde%@",appDelegate.dayPrint);
[appDelegate.thirdTab reloadInputViews1];
}
但这不起作用...我无法在标签中打印值。如何做到这一点..从 UIViews 获取值
【问题讨论】:
标签: iphone ios uiview uiviewcontroller reload