UIVIewcontrollerからデータをリロードするにはどうすればよいですか。UIView実際には、のカスタムUIVIewControllerクラスクラスを持つ があります。今では、ラベルがあり、で定義されているラベルの値を印刷する必要があります。しかし、最初にコンパイルされた後、コンパイラは.thenに移動し、どうすれば印刷またはリロードできますかUIViewUIViewcontrollerUIViewviewdidloadUIViewControllerUIViewUIVIewController
. クラスから取得した との値UILabel Textを定義しましたViewDidLoadUIViewControllerUIView
では、どうすれば をリロードできますかUIViewController。
私がやっていることは次のとおりです。
UIVIewController (secondTab) クラス
-(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から値を取得するには