作者Gsus (肉元,吉米,助教)
看板MacDev
标题[问题] 程式的流程-viewController想call superViewController 方法
时间Fri Jul 23 10:30:47 2010
我有一个程式是这样的
一开始在appDelegate中会init 2 个controller
-firstViewController
-textView
-containerView
-aViewController
-bViewController
-tabBarController
流程如下:
我先add firstViewController.view
[windows addSubview:firstViewController.view];
在firstViewController.view中包含了两个view
-textView
-containerView
在containverView中会视情况add 两种 view
可能是 -aViewController.view
或者是 -bViewController.view
不论是aViewController.view or bViewController.view中
最终都要按下一个button,然後就该换tabBarController.view上场,
然後firstViewController.view就要被remove
问题就出现在这边
我要怎麽在a/bViewController中remove自己 ?
并且让appDelegate去add tabBarController.view ?
--
1.
我知道的方法有利用protocol,在appDelegate中实作protocol的method
并且在a/bViewController中call appDelegate中的protocol method
但是我想问有没有其他的方法?
2.
也是可以直接在firstViewContoller.view上add tabBarController.view
但是因为firstViewController.view很少有机会会用到
甚至有时候程式进入时根据user defaults
就会决定不建立firstViewController instance
直接开始tabBarController.view
所以我想每次进入程式都让firstViewController在那边也不太好
不知道这样思考正不正确
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 114.136.190.30