Getting reference error from appledoc when embedding code in comments

| | August 5, 2015

I have some code comments like this:

How to use this method.

@discussion To use it, do something like the following

    id hook = [[STDeallocHook alloc] initWithBlock:^{
        // Do something when 'hook' is dealloced

So the code example is indented with 4 spaces. When I compile the docset with appledoc, it compiles correctly and shows the code as code in the API reference I generate. However back in XCode (Where I have appledoc creating warnings for issues in the doco) I get the warning:

Invalid [[STDeallocHook alloc] reference found hear STDeallocHook.h@16, unknown object: [STDeallocHook !

I think what’s happening is that appledoc is looking for markdown links inside the code block.

How can I stop this warning from appearing?

Leave a Reply