我想將UIViewController類作爲子視圖添加到現有類,所以我使用了下面的代碼。在UIView中添加UIViewController給予麻煩
myEventsView = [[EventNameViewController alloc]initWithNibName:@"EventNameViewController" bundle:nil];
[myEventsView.view setFrame:CGRectMake(0, 39, 320, 400)];
[self.view addSubview:myEventsView.view];
它成功添加,但問題是與按鈕動作,那些具有導航到其他視圖控制器動作不工作。這些行動方法被稱爲,但行動沒有執行,不明白爲什麼如此,請爲上述指導。
在此先感謝。
EventNameViewController是UINavigationController的子類嗎? – 2013-05-02 08:02:07
@Ishank EventNameViewController是一個UIViewController類。 – 2013-05-02 08:45:40