PDA

View Full Version : App crashes on bannerViewDidLoadAd




themoonisdown09
Jan 31, 2011, 07:38 PM
I have an iPhone app that seems to be crashing in the bannerViewDidLoadAd: method. It crashes on this line in the method:


banner.frame = CGRectOffset(banner.frame, 0, self.view.bounds.origin.y - 50);


Here is the thread in the crash report:


Date/Time: 2011-01-31 13:12:04.626 -0500
OS Version: iPhone OS 4.2.1 (8C148a)
Report Version: 104

Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x00000000, 0x00000000
Crashed Thread: 0


Thread 0 Crashed:
0 libSystem.B.dylib 0x311de2d4 __kill + 8
1 libSystem.B.dylib 0x311de2c4 kill + 4
2 libSystem.B.dylib 0x311de2b6 raise + 10
3 libSystem.B.dylib 0x311f2d72 abort + 50
4 libstdc++.6.dylib 0x301dea20 __gnu_cxx::__verbose_terminate_handler() + 376
5 libobjc.A.dylib 0x319a2594 _objc_terminate + 104
6 libstdc++.6.dylib 0x301dcdf2 __cxxabiv1::__terminate(void (*)()) + 46
7 libstdc++.6.dylib 0x301dce46 std::terminate() + 10
8 libstdc++.6.dylib 0x301dcf16 __cxa_throw + 78
9 libobjc.A.dylib 0x319a14c4 objc_exception_throw + 64
10 CoreFoundation 0x314d212c -[NSObject(NSObject) doesNotRecognizeSelector:] + 96
11 CoreFoundation 0x31479aa2 ___forwarding___ + 502
12 CoreFoundation 0x314d1a50 __forwarding_prep_1___ + 48
13 MyAppName 0x00004518 -[ReminderListTableViewController bannerViewDidLoadAd:] (ReminderListTableViewController.m:631)
14 iAd 0x30cc82f8 -[ADBannerView sessionBannerViewDidLoad:] + 52
15 iAd 0x30ccc3e0 -[ADSession bannerViewDidLoadAdMessage:userInfo:] + 140
16 CoreFoundation 0x3147bcfc __invoking___ + 60
17 CoreFoundation 0x3147bbce -[NSInvocation invoke] + 102
18 iAd 0x30cd0bda -[ADMessageProxy forwardInvocation:] + 74
19 CoreFoundation 0x31479ae6 ___forwarding___ + 570
20 CoreFoundation 0x31479858 _CF_forwarding_prep_0 + 40
21 iAd 0x30cd01d2 -[ADDistributedMessagingCenter messagePort:receivedMessage:withData:] + 130
22 iAd 0x30cd068a ADMessagePortCallBack + 34
23 CoreFoundation 0x314913fe __CFMessagePortPerform + 242
24 CoreFoundation 0x314656f8 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 20
25 CoreFoundation 0x314656bc __CFRunLoopDoSource1 + 160
26 CoreFoundation 0x31457f76 __CFRunLoopRun + 514
27 CoreFoundation 0x31457c80 CFRunLoopRunSpecific + 224
28 CoreFoundation 0x31457b88 CFRunLoopRunInMode + 52
29 GraphicsServices 0x35d664a4 GSEventRunModal + 108
30 GraphicsServices 0x35d66550 GSEventRun + 56
31 UIKit 0x338d5322 -[UIApplication _run] + 406
32 UIKit 0x338d2e8c UIApplicationMain + 664
33 MyAppName 0x000025c2 main (main.m:14)
34 MyAppName 0x0000258c start + 32


Now, before you tell me to release the iAd's delegate, I already am. In my dealloc method, I am doing this:


adBanner.delegate = nil;
[adBanner release];


This very frustrating because it looks like I am doing everything right. I was not having this error until a couple months after I released it with iAds. I would really appreciate the help.


Edit: If it helps, I used Interface Builder to add the iAd. I've checked the code file to see if there was anywhere that I am releasing the adBanner, but there is not (except in the dealloc method).



dejo
Feb 1, 2011, 10:46 AM
Have you tried invoking the debugger to investigate what the actual values of your variables are for this line?

themoonisdown09
Feb 1, 2011, 08:19 PM
Have you tried invoking the debugger to investigate what the actual values of your variables are for this line?

That's the problem, I can't recreate this crash when debugging on my device or in the simulator. I actually tested this app for a month on my device before I released it. Now, with real ads being pushed, it seems to crash.

My only guess is that the adBanner is nil. I'm not sure how it could be though.

dejo
Feb 1, 2011, 11:22 PM
Is there a difference between banner and adBanner?

themoonisdown09
Feb 2, 2011, 07:40 AM
Is there a difference between banner and adBanner?

banner is the parameter in the bannerViewDidLoadAd: method.

adBanner is the private variable which also has a property self.adBanner. The property is being retained.

dejo
Feb 2, 2011, 10:24 AM
Well, since the line your error is occurring on makes no mention of adBanner, I don't think you need to suspect it.

But since you can't recreate the crash, I'm not sure what I can say at this point. That really sucks and I hope that you are able to figure something out.