zoukankan      html  css  js  c++  java
  • objc之method&class attributes

    objc之method&class attributes】  

      Objective-C now supports some gcc attributes for Objective-C methods. Syntactically, attributes for a method follow the method's declaration, and attributes for a method parameter sit between the parameter type and the parameter name. Supported attributes include:

      Deprecation and availability, including AvailabilityMacros.h

      - (void)method:(id)param  __attribute__((deprecated));

      Unused parameters

      - (void)method:(id) __attribute__((unused)) param;

      Sentinel parameters, including NS_REQUIRES_NIL_TERMINATION

      - (void)methodWithObjects:(id)obj, ...  NS_REQUIRES_NIL_TERMINATION;

      Objective-C also supports some gcc attributes for Objective-C classes. Syntactically, attributes for a class precede the class's @interface declaration. Supported attributes include:

      Deprecation and availability, including AvailabilityMacros.h

      __attribute__((deprecated))

      @interface MyDeprecatedClass : SomeSuperclass

      Visibility

      __attribute__((visibility("hidden")))

      @interface MyPrivateClass : SomeSuperclass

  • 相关阅读:
    Windows netsh命令的使用
    源码安装 qemu-2.0.0 及其依赖 glib-2.12.12
    .ko文件
    Suse环境下编译linux-2.6.24内核
    cut
    POJ3648 Wedding
    [Hnoi2010]Planar
    [中山市选2011]杀人游戏
    BZOJ3033 太鼓达人
    POJ1041 John's trip
  • 原文地址:https://www.cnblogs.com/tekkaman/p/3065400.html
Copyright © 2011-2022 走看看