首页 > 其他 > 详细

Dynamic Method Resolution

时间:2014-02-17 14:02:02      阅读:365      评论:0      收藏:0      [点我收藏+]

Dynamic Method Resolution

  @dynamic directive 用于声明属性的方法dynamic loading,which tells the compiler that the methods associated with the property will be provided dynamically。即编译期不实现此方法,而由动态加载。此directive的作用在于告诉编译器某个类的实例拥有某属性而不会报编译错误。

  You can implement the methods resolveInstanceMethod: and resolveClassMethod: to dynamically provide an implementation for a given selector for an instance and class method respectively. For example:

  bubuko.com,布布扣

  A class has the opportunity to dynamically resolve a method before the forwarding mechanism kicks in. If respondsToSelector: or instancesRespondToSelector: is invoked, the dynamic method resolver is given the opportunity to provide an IMP for the selector first. If you implement resolveInstanceMethod: but want particular selectors to actually be forwarded via the forwarding mechanism, you return NO for those selectors.

Dynamic Method Resolution

原文:http://www.cnblogs.com/tekkaman/p/3551896.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!