开发者

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;
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜