问题
I'm using this Admob plugin for Phonegap running on iOS like this:
window.plugins.AdMob.createBanner({"siteId":"my-site-id"});
window.plugins.AdMob.loadBanner();
// move banner to make it appear
window.plugins.AdMob.moveBanner({"positionX":0,"positionY":410});
And it's actually working. The problem is that this is causing my app to consume a lot memory, and the app to crush when on a device according to the Apple crash report I got from iTunesConnect.
Can you help me in understanding how to use this plugin?
Thanks!
回答1:
Are you using the deletBanner: method anywhere? I think there may be a memory leak there possibly. The plugin looks like it removes the adBanner property from its superview and nil's it out, but I think it may need to also:
- Set the
delegate
foradBanner
tonil
- Release the
adBanner
(you can double-check this by seeing what the retain count of theadBanner
is). I think UIViewController'sdealloc
automatically callsremoveFromSuperView
: butdeleteBanner
: probably wouldn't do that?
来源:https://stackoverflow.com/questions/10675978/how-to-use-admob-phonegap-plugin-with-ios