3
在我的應用程序之前,我已經添加了一個標籤視圖,它連接到一個插座,但沒有顯示出來,當我第一次從另一個視圖控制器分配此插座,然後調用pushViewController
來顯示它。下面是顯示標籤推動下一個視圖之前代碼:設置視圖控制器屬性pushViewController
CustomViewController *vc = [[CustomViewController alloc] init];
vc.lbl_price.text = self.label_price.text; // lbl_price is defined as a property in CustomViewController and label_price is defined in current view controller
[self.navigationController pushViewController:vc];
在CustomViewController
viewDidLoad
方法添加此指令,看看它是否應該工作
NSLog(@"Price=%@",lbl_price); // it actually prints out what was previously assigned
但它並不顯示在標籤!
任何想法,爲什麼?
斯特凡