开发者

How to use compiler #warning in my code?

开发者 https://www.devze.com 2023-03-09 18:23 出处:网络
I am writing a larger project and am trying to make a deprecated method \"print\" a #warning about the deprecation when the method is called.

I am writing a larger project and am trying to make a deprecated method "print" a #warning about the deprecation when the method is called.

How could I do so? Just again: I have this

#warning -methodname:(id)sender is deprecated, use ...

I o开发者_StackOverflow中文版nly want this message appear in the build warnings, if the message is called, not all the time.


Place this after the declaration of the method, before the semicolon: __attribute__((__deprecated__))

0

精彩评论

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