问题描述
我使用这Admob的插件PhoneGap的运行在这样的iOS:
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});
和它的实际工作。问题是,这是导致我的应用程序,以消耗大量的内存,并且该应用时,设备上根据苹果的崩溃报告,我从iTunesConnect得到粉碎。
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?
谢谢!
推荐答案
您使用deletBanner:法哪儿了吗?我觉得有可能是内存泄漏有可能。该插件看起来像它会从它的父和为零的这出adBanner财产,但我认为这可能还需要:
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:
- 将
代理
为adBanner
到零
- 解除
adBanner
(你可以看到什么保留的adBanner
是数仔细检查这一点) 。我想的UIViewController的的dealloc
自动调用removeFromSuperView
:但deleteBanner
:可能会那样做?
- 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?
这篇关于如何使用Admob的PhoneGap的插件与iOS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!