由于iAd,我得到了一个非常奇怪的崩溃。这是调试器输出:
2010-07-29 17:25:57.032 MemoryMatcherFree[5326:307] -[__NSOperationInternal bannerViewDidLoadAd:]: unrecognized selector sent to instance 0x13fda0
2010-07-29 17:25:57.051 MemoryMatcherFree[5326:307] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSOperationInternal bannerViewDidLoadAd:]: unrecognized selector sent to instance 0x13fda0'
*** Call stack at first throw:
(
0 CoreFoundation 0x3513cfd3 __exceptionPreprocess + 114
1 libobjc.A.dylib 0x303928a5 objc_exception_throw + 24
2 CoreFoundation 0x35140a77 -[NSObject(NSObject) doesNotRecognizeSelector:] + 102
3 CoreFoundation 0x3513ff15 ___forwarding___ + 508
4 CoreFoundation 0x350d2680 _CF_forwarding_prep_0 + 48
5 iAd 0x30fe70c7 -[ADBannerView transitionToNextBanner:] + 1230
6 iAd 0x30fe69b7 -[ADBannerView _adManagerLoadedBannerData:] + 314
7 iAd 0x30fddf13 -[ADCache _notifySuccess] + 358
8 iAd 0x30fde25f -[ADCache _dispatchResponses] + 50
9 Foundation 0x339ccbd9 __NSFireTimer + 136
10 CoreFoundation 0x35112a5b __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 14
11 CoreFoundation 0x35114ee5 __CFRunLoopDoTimer + 860
12 CoreFoundation 0x35115865 __CFRunLoopRun + 1088
13 CoreFoundation 0x350be8eb CFRunLoopRunSpecific + 230
14 CoreFoundation 0x350be7f3 CFRunLoopRunInMode + 58
15 GraphicsServices 0x309776ef GSEventRunModal + 114
16 GraphicsServices 0x3097779b GSEventRun + 62
17 UIKit 0x321c12a7 -[UIApplication _run] + 402
18 UIKit 0x321bfe17 UIApplicationMain + 670
19 MemoryMatcherFree 0x00002b77 main + 70
20 MemoryMatcherFree 0x00002b2c start + 40
)
terminate called after throwing an instance of 'NSException'
Program received signal: “SIGABRT”.
任何想法/尝试的事情都将非常感激。欢呼声。
答案 0 :(得分:-1)
您确定已发布bannerView的代表吗?我创建了一个名为“releaseBannerView”的方法。我是这样做的,所以我可以“弱”链接我的iAd.framework,并且只有在iAd类存在的情况下才调用该方法。对于向后的能力非常有效。
-(void)releaseBannerView {
//Test for the ADBannerView Class, 4.0+ only (iAd.framework "weak" link Referenced)
Class iAdClassPresent = NSClassFromString(@"ADBannerView");
//If iOS has the ADBannerView class, then iAds = Okay:
if (iAdClassPresent != nil) {
//If instance of BannerView is Available:
if (self.bannerView) {
//Release the Delegate:
bannerView.delegate = nil;
//Release the bannerView:
self.bannerView = nil;
}
}
}
然后在需要的时候,在我的Dealloc方法中,我可以通过调用这个方法来取消bannerView:
- (void)dealloc {
[super dealloc];
[self releaseBannerView];
..and.others...
}