zoukankan      html  css  js  c++  java
  • iOS.ObjC.Compiler.Directives

    Objective-C Compiler Directives

    @dynamic

    "You use the @dynamic keyword to tell the compiler that you will fulfill the API contract implied by a property

    either by providing method implementations directly or at runtime using other mechanisms such as dynamic

    loading of code or dynamic method resolution. " R[0]p61

     

    "@dynamic just tells the compiler that the getter and setter methods are implemented not by the class itself

    but somewhere else (like the superclass or will be provided at runtime)."  Ref[4]

    "Tells the compiler the setter and getter methods for the given (comma separated) properties are implemented manually,

    or dynamically at runtime. Accessing a dynamic property will not generate a compiler warning, even if the getter/setter

    is not implemented. You will want to use @dynamic in cases where property getter and setter methods perform custom code.

    @end – Marks end of class implementation." Ref[8]

    @synthesize

    "Generate setter and getter methods for a comma separated property list according to property modifiers.

    If instance variable is not named exactly like @property, you can specify instance variable name after the equals sign." Ref[8]

    __attribute__

    iOS.ObjC.__attribute__-directives

      


    Reference

    0. Objective-C 2.0 Programming Language

    1. http://www.learn-cocos2d.com/2011/10/complete-list-objectivec-20-compiler-directives/

    2. http://stackoverflow.com/questions/4621952/what-does-dynamic-do-in-objective-c

    3. http://www.meonbinary.com/2013/05/objective-c-associated-objects

    4. Objective-C: @synthesize vs @dynamic

    http://ios-blog.co.uk/tutorials/objective-c/synthesize-vs-dynamic/

    5. @dynamic vs @synthesize (To Read)

    http://andiputra7.tumblr.com/post/16822250097/dynamic-vs-synthesize

    6. When should I use @synthesize explicitly? 

    https://stackoverflow.com/questions/19784454/when-should-i-use-synthesize-explicitly

    7. @synthesize keyword explanation

    https://forums.developer.apple.com/thread/69075

    8. Objective-C @Compiler Directives

    https://kapeli.com/cheat_sheets/Objective-C_@Compiler_Directives.docset/Contents/Resources/Documents/index

    9. @

    http://nshipster.com/at-compiler-directives/

    ---
  • 相关阅读:
    uva 10474 Where is the Marble?(简单题)
    【cocos2d-x 3.7 飞机大战】 决战南海I (二) 我方飞机的实现
    STM32中assert_param的使用
    OC语言--内存管理
    php通过shell调用Hadoop的方法
    前端JSON使用总结
    Google地图接口API之Google地图 API 参考手册(七)
    Google地图接口API之地图类型(六)
    Google地图接口API之地图控件集(五)
    Google地图接口API之地图事件(四)
  • 原文地址:https://www.cnblogs.com/cwgk/p/3163442.html
Copyright © 2011-2022 走看看