What exactly does "adopt a protocol" mean in the Objective-C / Cocoa documentation ?
- by driis
I am a C# developer getting started on Objective-C / Cocoa Touch programming. I think I might have gotten some terms wrong because I keep thinking about them "the C# way".
Specifically, I have come around the term "protocol" in various documentation and tutorials.
In Objective-C, what exactly is a protocol ? Can it be compared to a C# interface ?
Is the following declaration the same as saying "The class is implementing the protocol UITextFieldDelegate" ? Or is UITextFieldDelegate to be compared with a generic type parameter in C# ?
@interface MyViewController : UIViewController <UITextFieldDelegate> { }