#if statement in header file leads to incomplete parsing #151

Tafkadasoh opened this Issue Nov 24, 2011 · 3 comments


None yet

2 participants


I'm developing a library for my company which uses Apple's AVFoundation framework. As AVFoundation isn't available for the iOS Simulator, I have to dynamically exclude some lines of code from my headers when compiling for Simulator, which I accomplished by adding some #if checks.

Unfortunately, these checks will break the appledoc parsing. In my example, the method documentation of the class is lacking, and the protocol defined & documented at the bottom of the same header file is also missing.

The problem orginiates due to the following lines:
@interface NEOMViewfinderViewController : UIViewController {
@interface NEOMViewfinderViewController : UIViewController {

As it's probably very elaborate/complex to correctly parse #if checks, it would be sufficient (in my opinion) to get an error or warning in the appledoc log.

P.S.: I really like your project. Keep up the good work!

tomaz commented Nov 24, 2011

Hm, I've already fixed that - see #43 where a user reported similar issue with #ifdef. The solution should be universal though, so as long as two class declarations are matched (as in your example), the first one is taken and second one ignored. Looking at your code, the difference seems to be { inside the #if section, try moving it outside to see if that would help. Also this should work on interface level, not sure if it also covers methods...

Moving out the { fixed the problem. Thank you very much!

tomaz commented Nov 24, 2011

Glad it worked! Not ideal, but something to keep in mind for documentation update...

@tomaz tomaz closed this Nov 24, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment