开发者

implement method FlipsideViewController in the MainViewController

just a simple question : if you write a method in the .h file, you don't "have" to write the implementation in the .m file? i discovered that with FlipsideViewCo开发者_StackOverflow中文版ntroller, if you create a new projet (utility application), the method : "flipsideViewControllerDidFinish" is actually "implemented" in the "MainViewController.m". i just wanted to have this clear, thanks for your answer ;)

Paul


FlipsideViewControllerDelegate is a protocol declared in FlipsideViewController.h and adopted by (implemented in) MainViewController. The main view controller needs to know when the flip side controller is done, but it doesn't make sense for FlipsideViewController to know specifics about MainViewController. All it needs to know is that there's an object that it's supposed to notify when it's done, and that that object implements the methods in the FlipsideViewControllerDelegate protocol. This is the delegation pattern: read more about it in How Delegation Works.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜