require that an object passed into an objective C method conform to a protocol?
Is this possible? For example, I have a class TriangleDataView with an init method. Currently the method is declared like this:
- (id)initWithFrame:(CGRect)frame delegate: (id) delegateObject;
I would like to require that delegateObject conform to the UIT开发者_如何转开发extFieldDelegate protocol. But what is the syntax for that?
- (id)initWithFrame:(CGRect)frame delegate:(id<UITextFieldDelegate>)delegateObject;
精彩评论