开发者

Explanation of declaration: id<a_name> delegate;

I 开发者_开发技巧am learning Objective-C and I would like to know what the meaning and the purpose of the following declaration is:

   id<A_specific_name> delegate;


This means delegate is a variable that has the general type id and it conforms to A_specific_name protocol.

id is typedef on void *, and a protocol is a concept similar (but not the same exactly) to Java interfaces.


It is an object conform to "A_specific_name" protocol (interface)

You can read Apple doc on objective-C

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜