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/

    ---
  • 相关阅读:
    后台写js 并跳转
    visual studio 2010 js 调试
    网页搜索功能 多表搜索sql
    c# 取得扩展名
    ajaxFileUpload 注意!
    ajaxFileUpload js判断类型
    sortable items不让他拖,也不让他放。cancel不然他拖动
    json 多重嵌套反序列化和序列化
    C#串口操作类,包括串口读写操作
    C#操作Word的超详细总结
  • 原文地址:https://www.cnblogs.com/cwgk/p/3163442.html
Copyright © 2011-2022 走看看