设备中的EXC_BAD_ACCESS,而不是模拟器中的EXC_BAD_ACCESS [英] EXC_BAD_ACCESS in device, not in simulator

查看:86
本文介绍了设备中的EXC_BAD_ACCESS,而不是模拟器中的EXC_BAD_ACCESS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在项目中实现了adwhirl.我以前在我的项目中已经实现了它,所以我只是将它从以前的版本中合并到了我的当前项目中.

I have implemented adwhirl in my project. I have implemented it previously in my projects, so I just incorporated it into my current project from my previous.

- (UIViewController *)viewControllerForPresentingModalView {
{
  return self;
}

我在以前的项目中曾使用过此方法..因为我的window.rootvviewcontroller仅用于自我.但是在我当前的项目中,有很多屏幕用来展示广告,所以我使用了:

I had used this in my previous projects..since my window.rootvviewcontroller was self only. But in my current project there are many screens on which I am showing ads, so I have used:

- (UIViewController *)viewControllerForPresentingModalView {
    {
      return return [[(AppDelegate *)[[UIApplication sharedApplication] delegate] window] rootViewController] ;;
    }

主要问题是程序崩溃了,而且仍然如此.起初一切都还好:iads测试广告已加载,但很少崩溃.我很快了解到,这是因为 Admob .由于admob广告大部分时间未加载,因此崩溃很少.

The main problem is the program was crashing, and still is. At first everything was okay: iads test ads loaded up, but it crashed rarely. I soon understand it was because of Admob. It crashed rarely because admob ads were not loaded most of the time.

现在,在搜索这些崩溃时,我遇到了一个问题,因为我是用Xcode 4.2创建项目的,而不是以前的Xcode 4.0项目,所以在窗口和视图控制器中具有很强的属性.我删除了.

Now searching for these crashes, I came across a point that since I have made the project in Xcode 4.2 rather than my previous projects Xcode 4.0 there were strong attributes in my window and view controller. I removed it.

现在问题出在模拟器上,它没有崩溃,但它在设备上崩溃了.

Now the problem is in simulator it doesn't crash but it crashes in device.

错误是在我将adview添加为子视图之后,并且它-(UIViewController *)viewControllerForPresentingModalView 通过了此功能,但是之前 adWhirlDidReceiveAd 方法.

The error is after I have added adview as a subview and it has - (UIViewController *)viewControllerForPresentingModalView went through this function but before adWhirlDidReceiveAd method.

实际崩溃为 [GADRequestPrivate spamSignals] EXC_BAD_ACCESS.

推荐答案

以下答案已经为我赢得了赏金:) .....您可以尝试解决您的问题...

Below answer has already earned bounty for me :) ..... you can try for your problem...

链接:进入崩溃的底部

我找到了调试Crash代码的最佳方法之一.请点击调试技术链接:

I found one of the best way to Debug the code for Crash. Follow the link for Debugging technique:

http://www.cocoadev.com/index.pl?DebuggingAutorelease

您需要非常仔细地分析控制台,才能真正了解崩溃的原因.这对几乎所有未启用ARC的代码都有帮助.

You need to analyze your Console very carefully to see actually why the Crash occurs. This helped me in almost all of the Code that are without ARC enabled.

这篇关于设备中的EXC_BAD_ACCESS,而不是模拟器中的EXC_BAD_ACCESS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆