我有兩個視圖控制器A & B.從我發回一些數據到視圖控制器。我B ViewController
嵌入在NavigationController
。現在我要從下面的代碼從A到B.在這種情況下,我的委託方法不會被調用。設置viewcontoller的代表問題?
let storyboard = UIStoryboard(name: "DropboxView", bundle: nil)
let vc = storyboard.instantiateViewController(withIdentifier: "nav_drop") as! UINavigationController
let vc1:DropboxListingViewController = storyboard.instantiateViewController(withIdentifier: "DropboxListingViewController") as! DropboxListingViewController
vc1.CTprotocolDelegate = self
self.present(vc, animated: true, completion: nil)
請提出一個更好的方法。
你是什麼意思,你的委託方法永遠不會被調用?你在哪裏試圖調用委託方法? – AdamPro13
在第一個視圖控制器中 – Techiee