2014-12-03 51 views
-1

如何在objective-c XIB窗口中創建模態窗口? 我已經創建了多列表,現在onclick任何行,即didSelectRowIndexPath事件我想要打開一個模式窗口。XIB模態窗口ios

回答

0

在行中選擇單元格時。定義你想在你的模態視圖中顯示的視圖控制器。

YourViewController *vc = [[YourViewController alloc] initwithnibname:@"YourViewController" bundle:nil]; 
vc.(delegatemethod) = self; 
[self presentViewController:vc animated:YES completion:NULL]; 
+0

您好,我做上面的東西在下面的步驟:1)@protocol myViewControllerDelegate 2)@屬性(非原子,弱)的id 委託創建的代表; 3)從我的基礎控制器--- @interface mybaseController:uiTableViewController 。然後在mybasecontroller中,我編寫的代碼首先編譯好了,但它的功能已經嵌入myViewController。 – saurabh 2014-12-04 16:29:27

+0

我需要看到這個代碼。你爲什麼不嘗試調試,並檢查它停在哪裏? – Chai 2014-12-05 06:08:38