Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
321 views
Welcome To Ask or Share your Answers For Others

1 Answer

If you weak-link the iAd framework, you will encounter no issues with a controller class that conforms to the ADBannerViewDelegate protocol. You will, of course, need to add the ADBannerView programmatically (if it exists on the running OS) or otherwise load a different Nib file for 3.x vs. 4.x.

Even though there is no ADBannerViewDelegate protocol in iPhone OS 3.x, I just tested and no errors are thrown for missing symbols if a class that conforms to it is loaded in that older OS.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...