作者BlueKidds (何去何从)
看板MacDev
标题Re: [问题] 程式的流程-viewController想call supe …
时间Sat Jul 24 11:54:04 2010
※ 引述《Gsus (肉元,吉米,助教)》之铭言:
: 我还想多问一个问题
: 有没有一种可能是在 a/bViewController 中判断
: 有哪些 objects 手中 hold 自己 instance
: 然後取得那些 objects 的 reference
: 接着我就可以 call 那些 objects 的 methods
如果a/bViewController是 aTabBarController的 instances(举例)
用 a/bViewController.parentViewController取aTabBar
如果是在appDelegate产生的话
因为他可以产生很多个不同的a/bViewController的instances
所以去取自己holder拿他的function的话
不如把他设成自己的delegate
然後判断是不是自己呼叫 再去呼叫想要的function
不过 在自己设计的时候
就应该了解谁持有谁
再去拿(举例appdelegate)这个singleton的delegate去设计想要做的那些事
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 114.42.50.135
1F:推 Gsus:谢谢! 受益良多~ 07/25 03:06