I sounds like a stupid question, but it seems I cannot release an adMob GADBannerView.
Admob documentation says don't call "release" when using ARC. Needless to say you cannot call release because it's not allowed and generates an error. I tried this:
@property (nonatomic, strong) GADBannerView *adMobView;
…
[adMobView removeFromSuperview];
adMobView.delegate = nil;
adMobView = nil;
But nothing happens. It becomes nil but still stays on the screen. It supposed to be a subclassed UIView. At the best I can hide it but it still received ads and obviously stays in the memory.
Any Ideas?
Try weak reference
@property (nonatomic, weak) GADBannerView *adMobView;
Weak
weak is similar to strong except that it won't increase the reference count by 1. It does not become an owner of that object but just holds a reference to it. If the object's reference count drops to 0, even though you may still be pointing to it here, it will be deallocated from memory.
Refer more here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With