开发者

How can I deprecate an entire protocol?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜