Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

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

Closed
Tafkadasoh opened this Issue · 3 comments

2 participants

@Tafkadasoh

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:
#if !(TARGET_IPHONE_SIMULATOR)
@interface NEOMViewfinderViewController : UIViewController {
#else
@interface NEOMViewfinderViewController : UIViewController {
#endif

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
Owner

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...

@Tafkadasoh

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

@tomaz
Owner

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

@tomaz tomaz closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.