Just add the attribute to the ad:
@interface Blah - (void)method __attribute__((deprecated)); @end
If your sentences are correct for translation, this should work fine. Perhaps you added the attribute to the definition, and not to the declaration? Otherwise, a demo will help (sample code).
Update
Although the above approach works for typical messages, it seems that clang is confused with IBAction s.
With clang, IBAction attributes are implicitly inserted (for what used to be typedef ).
If the attribute is specified only in the declaration, the output of the preprocessor is as follows:
// preprocessed declaration - (void)__attribute__((ibaction))setSomething:(id)sender __attribute__((noreturn)); // preprocessed implementation - (void)__attribute__((ibaction))setSomething:(id)sender ...
So, it seems that the compiler is just confused by this hidden decoration, and you should also add an attribute to the implementation / definition to suppress the warning when the method is an IBAction .
justin Apr 11 '12 at 7:01 2012-04-11 07:01
source share