iPhone + AdMob +删除广告视图
我已将 AdMob 集成到我的 iPhone 应用程序中。
我在 UIViewController 中添加一个广告视图,如下所示:
ProgrammaticAdViewController *temp = [[ProgrammaticAdViewController alloc] init];
temp = [[ProgrammaticAdViewController alloc] initWithNibName:nil bundle:nil];
[self.view addSubview:temp.view];
因此,我将能够在 UIViewController 顶部看到一个广告视图。
现在我有两个问题:
我无法点击已添加广告视图的 UIViewController 的某些按钮。因此,出于临时目的,我将广告视图添加为:
[self.view insertSubView:temp.view atIndex:1];
我想在一段时间后删除广告视图,所以我使用:
[temp.view removeFromSuperView];
但我的广告视图没有被删除。
请帮我。
问候, 普拉蒂克
I have integrated AdMob in my iPhone application.
I am adding an Ad view in of my UIViewController as follows:
ProgrammaticAdViewController *temp = [[ProgrammaticAdViewController alloc] init];
temp = [[ProgrammaticAdViewController alloc] initWithNibName:nil bundle:nil];
[self.view addSubview:temp.view];
So, I will be able to see an Ad view on top of my UIViewController.
Now I have two problems:
I am not able to tap on certain buttons of my UIViewController on which I have added the Ad View. So, for temporary purpose I adding the Ad view as:
[self.view insertSubView:temp.view atIndex:1];
I want to remove the Ad view after sometime so I am using:
[temp.view removeFromSuperView];
But my Ad view is not being removed.
Please help me.
Regards,
Pratik
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您在这里造成了内存泄漏:
选择一个,不要同时使用两者。
然后您可以为“temp”设置一个“标签”:
然后当您想删除它时使用:
希望有帮助
You're creating a memory leak here:
Pick one, don't use both.
You could then set a 'tag' for "temp":
Then when you want to remove it use:
Hope that helps