开发者

How can I deprecate an entire protocol?

开发者 https://www.devze.com 2023-04-04 11:37 出处:网络
Is it possible to deprecate an entire protocol?I\'m using the GCC compiler that is shipped with iOS SDK 5.0 Beta 7.

Is it possible to deprecate an entire protocol? I'm using the GCC compiler that is shipped with iOS SDK 5.0 Beta 7.

DEPRECATED_ATTRIBUTE doesn't seem to work.

For example, the following开发者_运维百科 two statements do not compile.

  • @protocol DEPRECATED_ATTRIBUTE MyProtocol
  • @protocol MyProtocol DEPRECATED_ATTRIBUTE


I haven't tried this myself, but I think that the following syntax should work.

__attribute__ ((deprecated))
@protocol MyProtocol
@end

This parallels the syntax for deprecating an entire interface as well as a single method.

__attribute__ ((deprecated))
@interface MyClass
@end

@interface MyClass2
- (void) method __attribute__((deprecated));
@end
0

精彩评论

暂无评论...
验证码 换一张
取 消