I have a small application with iAds and let people pay for the update.
iAd is configured in the NIB application. I check the purchase status in the viewDidLoad method of the main UIViewController and call the following methods in the ADBannerView member:
[adBanner removeFromSuperview]
Unfortunately, if I observe the use of device data, some data is still being downloaded for the ad.
Is there a way to kill iAd correctly so that it does not load data?
I know that I could create an iAd representation programmatically, and then add it only if the user did not purchase the product, but my product works fine with NIB, and I do not want to change it for this reason.
UPDATE:
In my .h file, I have:
IBOutlet ADBannerView* adBanner;
In the .m file in - (void)viewDidLoad I have:
if (purchased) { [adBanner removeFromSuperview]; adBanner.delegate = nil; adBanner = nil; }
I would hope that this would be enough to remove the iAd before it gets the opportunity to download any data.
Alas, this is not enough to prevent data loading. I suspect that at this time there is a complete delay, but I do not know how to do this without calling dealloc myself.
Does anyone know a better / correct way to completely destroy an object loaded via XIB and assigned by IBOutlet ?
source share