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

  • 相关阅读:
    SQLite简介
    dockerfiles宝藏系列
    Docker容器运行GUI程序的配置方法
    Windows神器cmder
    Typora设置标题自动添加序号
    手机往电脑备份相册
    搜索引擎的高级使用技巧
    Django Model 模型
    前后端分离是什么操作
    搭建FTP(win10版)以及基本FTP操作
  • 原文地址:https://www.cnblogs.com/tekkaman/p/3065400.html
Copyright © 2011-2022 走看看