iphone - compiler conditional on header

Posted by Mike on Stack Overflow See other posts from Stack Overflow or by Mike
Published on 2010-03-21T07:59:33Z Indexed on 2010/03/21 8:01 UTC
Read the original article Hit count: 372

Filed under:
|
|

I have a project that generates applications for two targets.

One of the targets has to include one additional delegate protocol that should not be present on the other one. So, I have created a macro on Xcode and declared the header like this:

#ifdef TARGET_1
@interface myViewController : UIViewController <UIScrollViewDelegate, UIPopoverControllerDelegate>
#endif

#ifdef TARGET_2
@interface myViewController : UIViewController <UIScrollViewDelegate>
#endif

{ .... bla bla.... }

The problem is that Xcode is not liking this "double" declaration of @interface and is giving me all sort of problems.

How to solve that? thanks for any help.

© Stack Overflow or respective owner

Related posts about iphone

Related posts about iphone-sdk