Add a dynamic warning to the Xcode project

advertisements

I am asking my self if there are a way to add dynamic warning to my project.For exemple, every method in my class should begin by an analytics tag (setTagVorView:), if this line doesn't exists, I or other developers will be notified by a warning on this method.

Today, my only solution is to create a protocol (delegate) with a required method and every class (UIViewController for example) should follow this protocol and implements the required methods. The problem is : if the developer forgot the delegate, he will never be notified.

Another example, the appledoc command line tool add warnings to the project if some properties or methods don't have descriptions.

So how can i add my rules to predict warnings in some cases ?

Thank you.


Not sure if it fits your needs, but there is at least on way, hardcode way to achieve this goal: create a clang plugin and add there your own rules.

I'm not going very deep, because it might take too much time, but if you really interested in this solutions you can take a look at this blog-post, there is actually described a way to make the plugin with custom warnings and even errors