Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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
like image 421
Hyperbole Avatar asked Sep 13 '11 21:09

Hyperbole


1 Answers

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
like image 192
Chris Frederick Avatar answered Oct 18 '22 01:10

Chris Frederick