1

在我的项目中,我有一个拆分视图,并且之前使用 Apple iAdSuite 中的拆分视图示例实现了 iAd。现在我还想实现 Admob 广告,由于 Adwhirl 在 xcode 4.5 中出现了很多错误,我尝试使用 Admob 中介(iOS SDK 6.2.0)。

我加载了广告,并在必要时在 iAd 和 Admob 之间进行了适当的调解。然而,一个大问题仍然存在。在加载任何广告之前旋转设备(或模拟器)时,出现以下崩溃:

由于未捕获的异常“NSRangeException”而终止应用程序,原因:“ * -[__NSArrayI objectAtIndex:]:索引 0 超出空数组的范围”

*第一掷调用堆栈:(0x1b4e012 0x1701e7e 0x1b03b44 0x1c7ff 0x1c97b 0x1ba5b 0x1bff2 0x4581 0x699a0c 0x17156b0 0x701dfc0 0x701233c 0x701deaf 0x7386b4 0x6811a6 0x67fcbf 0x67fbd9 0x67ee34 0x67ec6e 0x67f435 0x67ef11 0x67eb2a 0x11c2dc9 0x1ba80c5 0x1b02efa 0x10f7482 0x8259be 0x6594d4 0x65a24b 0x64bcf8 0x1998df9 0x1998ad0 0x1ac3bf5 0x1ac3962 0x1af4bb6 0x1af3f44 0x1af3e1b 0x19977e3 0x1997668 0x64965c 0x203d 0x1f65)

libc++abi.dylib:终止调用抛出异常

作为一项测试,我还在 iAdSuite splitview 示例中实施了 Admob 中介( 可以在此处找到)并看到相同的崩溃。加载广告后,您可以随意旋转而不会崩溃。当我仅使用 Admob(无中介)时,我无法让这种崩溃发生。

似乎它在 Admob 代码中崩溃了,但可能还有其他一些我没有做对的事情导致这种情况。但在这一点上,我被困住了。有人知道如何让这次崩溃消失吗?

编辑:我得到了 Admob 在http://code.google.com/p/google-mobile-dev/downloads/list 提供的“智能横幅示例 1.2” 。我唯一“改变”的是添加实际的 Admob SDK 6.2.0 文件 iAdAdapter,添加 iAd 框架并使用中介 ID。当还没有加载广告时,这也会在轮换时崩溃。

我试图在 Google AdMob 广告开发者论坛上发布此问题,但短暂地闪现出类似帖子需要批准的内容。两天后,似乎还没有人查看批准队列。

4

1 回答 1

0

Looks like this might be an issue with the AdMob SDK. I would probably workaround it by setting a boolean (i.e firstAdReceived) when you get an ad the first time, and then checking that before you change the adSize and other banner characteristics on orientation change.

于 2012-10-05T19:37:23.743 回答