I've been looking at Apple's MVCNetworking example project and part of the interface definition for AppDelegate
is puzzling me. In the .h file we have this:
@interface AppDelegate : NSObject
{
...
But in the .m file we have this:
@interface AppDelegate () <SetupViewControllerDelegate>
...
So this class is privately conforming to the protocol. But why would you want to do this instead of publicly declaring it in the header?
AppDelegate
sets the delegate for the instance ofSetupViewController
to beself
(line 211 of AppDelegate.m) it needs to conform to the protocol. But because no other class should be able to useAppDelegate
in this way, this conformance should remain private. Thanks for your answer! – Pindling