Is it possible to conditionally include a protocol? For example, below is some code that does not work, but should give you an idea what I’m referring to. I only want the interface AdWhirlDelegate to be included if ads are turned on.
// this works fine
#if ADS_SUPPORTED
#import "AdWhirlView.h"
#endif
// this does NOT work
@interface MyAppDelegate : NSObject <UIApplicationDelegate #if ADS_SUPPORTED ,AdWhirlDelegate #endif>
You could do:
…but then IB can get a little confused. See this answer, which presents an alternative to that.