Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

EXC_BAD_ACCESS in device, not in simulator

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;
}

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] ;;
    }

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.

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.

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

The actual crash is [GADRequestPrivate spamSignals] EXC_BAD_ACCESS.

like image 850
Shubhank Avatar asked Nov 14 '22 10:11

Shubhank


1 Answers

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

Link : Getting to the bottom of 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

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.

like image 113
DShah Avatar answered Nov 16 '22 02:11

DShah