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.
精彩评论