How do I flag a method as deprecated in Objective-C 2.0?

前端 未结 5 452
天命终不由人
天命终不由人 2020-12-07 08:18

I\'m part of a team developing a fairly large iPad app and there are many different classes we\'ve created as a result. The trouble is some of the methods are now pretty mu

5条回答
  •  悲&欢浪女
    2020-12-07 08:56

    Deprecation Syntax

    Syntax is provided to mark methods as deprecated:

    @interface SomeClass
    -method __attribute__((deprecated));
    @end
    

    or:

    #include 
    @interface SomeClass
    -method DEPRECATED_ATTRIBUTE;  // or some other deployment-target-specific macro
    @end
    

提交回复
热议问题