[self performSegueWithIdentifier:@"LoginSuccess" sender:sender];
//改變prepareForSegue:
方法
標籤值
- (void)prepareForSegue:(UIStoryboardSegue *)segue {
if ([segue.identifier isEqualToString:@"LoginSuccess"]) {
UIViewController *loginVC = segue.destinationViewController;
//declare the string in .h file and assign it in viewDidLoad in loginVC
loginVC.labelString = @"CHECKING";
}
}
in loginViewController.h
file
@property(nonatomic, strong) NSString *labelString;
在loginViewController.m
文件
- (void)viewDidLoad
{
[super viewDidLoad];
self.labelStatus.text = labelString
}
做這個prepareSegue方法 –
@C_X我能問爲什麼? – LiamB
因此,視圖對象被初始化...在執行目標視圖之前不會在內存中,並且當您調用執行時,它實際上會創建目標視圖控件並將啓動該過程。但爲了更好地瞭解我們的問題,我會建議更多的代碼。 –