2011-12-04 13 views
0

아이디를 사용하는 iPhone 응용 프로그램이 있습니다. 응용 프로그램이 언젠가 다음 메시지와 충돌합니다.iPhone 응용 프로그램이 예외로 충돌합니다.

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFType bannerViewDidLoadAd:]: unrecognized selector sent to instance 0x621cd10' 
*** Call stack at first throw: 
(
    0 CoreFoundation      0x00e015a9 __exceptionPreprocess + 185 
    1 libobjc.A.dylib      0x00f55313 objc_exception_throw + 44 
    2 CoreFoundation      0x00e030bb -[NSObject(NSObject) doesNotRecognizeSelector:] + 187 
    3 CoreFoundation      0x00d72966 ___forwarding___ + 966 
    4 CoreFoundation      0x00d72522 _CF_forwarding_prep_0 + 50 
    5 CoreFoundation      0x00d71c7d __invoking___ + 29 
    6 CoreFoundation      0x00d71b51 -[NSInvocation invoke] + 145 
    7 CoreFoundation      0x00d72a04 ___forwarding___ + 1124 
    8 CoreFoundation      0x00d72522 _CF_forwarding_prep_0 + 50 
    9 iAd         0x00[Switching to process 8860 thread 0x207] 
0139f9 -[ADDistributedMessagingCenter messagePort:receivedMessage:withData:] + 251 
    10 iAd         0x00014012 ADMessagePortCallBack + 75 
    11 CoreFoundation      0x00db8f4c __CFMessagePortPerform + 396 
    12 CoreFoundation      0x00de2944 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52 
    13 CoreFoundation      0x00d42cf7 __CFRunLoopDoSource1 + 215 
    14 CoreFoundation      0x00d3ff83 __CFRunLoopRun + 979 
    15 CoreFoundation      0x00d3f840 CFRunLoopRunSpecific + 208 
    16 CoreFoundation      0x00d3f761 CFRunLoopRunInMode + 97 
    17 GraphicsServices     0x033fe1c4 GSEventRunModal + 217 
    18 GraphicsServices     0x033fe289 GSEventRun + 115 
    19 UIKit        0x002ffc93 UIApplicationMain + 1160 
    20 MyApp      0x00001ba8 main + 102 
    21 MyApp      0x00001b39 start + 53 
) 
terminate called after throwing an instance of 'NSException' 

아래는 내 NSZombie 메시지입니다.

# Category Event Type RefCt Timestamp Address Size Responsible Library Responsible Caller 
77 DetailController Zombie -1 04:01.914.883 0x5768bd0 0 iAd -[ADDistributedMessagingCenter messagePort:receivedMessage:withData:] 

또한 bannerViewDidLoadAd code;

- (void)bannerViewDidLoadAd:(ADBannerView *)banner 
{ 
    if (!bannerIsVisible) 
    { 
     [UIView beginAnimations:@"animateAdBannerOn" context:NULL]; 
     // assumes the banner view is offset -50 pixels so that it is not visible. 
     banner.frame = CGRectOffset(banner.frame, 0, -50); // if the banner is on top of the screen use 50 
     [UIView commitAnimations]; 
     bannerIsVisible = YES; 
    } 
} 

동일한 문제를 해결하도록 도와주세요. 고맙습니다.

+1

코드를 첨부하지 않았습니다. NSZombieEnabled를 켜십시오. 아마도 호출하는 객체가'nil'이지만 코드 비트가 없어도 말할 수 없습니다. –

+0

이 메소드를 호출하는 위치 인 bannerViewDidLoadAd :를 확인하십시오. 이 위치에 중단 점을 추가하고 코드를 디버그하십시오. – Robin

+0

NSZombie 메시지를 추가했습니다 .... 그냥 추가하려면 목록 및 세부 컨트롤러 (iAd가 있음)가 있습니다. 세부보기 목록보기로 이동할 때 몇 가지 경우에 메시지가 표시됩니다. – testndtv

답변

1

기본적으로 잘못된 개체 유형으로 bannerViewDidLoadAd:을 호출하고 있습니다. 이렇게하려면 일종의 디스패치 메커니즘을 사용하고있는 것 같습니다. 해당 메소드에 대한 디스패치 요청을 설정할 때 잘못된 객체를 지정했거나 객체를 유지하지 못했고 해당 객체가 삭제되어 NSType 객체로 교체되었습니다.

코드에서 bannerViewDidLoadAd:이 어디에 있는지 찾아서 사용중인 개체가 정확하고 적절하게 유지되는지 확인하십시오.

+0

bannerViewDidLoad가 사용 된 코드를 추가했습니다 ... – testndtv

+0

내 코드를 추가했습니다. 원래 질문 .. – testndtv

+0

@testndtv - 아니야. –

0

delegate가 릴리스 된 후에 bannerViewDidLoad가 호출되기 때문에 좀비 메시지가 릴리스됩니다.

귀하의 컨트롤러가 사라진 후에 귀하의 광고가 출시되지 않고 계속 남아 있다고 생각합니다.

+0

안녕하세요 ... thx 많이 ... 그렇다면 문제를 해결하려면 어떻게해야합니까? 아니면 어떻게 광고가 공개되는지 확인하려면 어떻게해야합니까? – testndtv

+0

보기 컨트롤러의 dealloc 메서드에서 [배너 릴리스] – Randall

+0

넣어 사실/viewDidLoad 로컬로 바코드 코드가 .... 내가 콘센트 또는 뭔가로 이동해야 ... 그것은 제공 할 수 있으면 좋을 것이다. 구현에 대한 추가 세부 정보 ... – testndtv

관련 문제