views:

30

answers:

1

Can I add the UIBannerViewDelegate protocol to my UIViewController subclass while remaining compatible with pre-iOS 4 devices?

This is NOT a duplicate, the question is specifically related to the delegate protocol.

A: 

I’d try something like:

#ifdef __IPHONE_4_0

@interface MYViewController <UIBannerViewDelegate, …>

#else

@interface MYViewController < … >

#endif

Remember to #include <TargetConditionals.h>;.

Edit: this question duped http://stackoverflow.com/questions/3128457 which has a more complete answer.

Evadne Wu