0
1 개의 iAd가있는 범용 앱이 있습니다. 이제 두 방향을 모두 지원해야합니다.iAd가 회전하지 않습니다.
다음 코드를 사용합니다.
- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {
if (&ADBannerContentSizeIdentifierPortrait != NULL) {
// NEWER
if (UIInterfaceOrientationIsLandscape(toInterfaceOrientation))
adView_.currentContentSizeIdentifier = ADBannerContentSizeIdentifierLandscape;
else
adView_.currentContentSizeIdentifier = ADBannerContentSizeIdentifierPortrait;
} else {
// OLDER
if (UIInterfaceOrientationIsLandscape(toInterfaceOrientation))
adView_.currentContentSizeIdentifier = ADBannerContentSizeIdentifier480x32;
else
adView_.currentContentSizeIdentifier = ADBannerContentSizeIdentifier320x50;
}
}
그러나 세로로 회전하면 내 응용 프로그램이 다음 오류로 중단됩니다.
인해 캐치되지 않는 예외 'NSInternalInconsistencyException'응용 프로그램 종료, 이유 : 'currentContentSize이 requiredContentSizes 중 하나 여야합니다; 'ADBannerContentSizeLandscape는' 은 {( ADBannerContentSizePortrait)} '
에 내가 IOS4.3 시뮬레이터에 테스트입니다하지 않습니다.
도와주세요. 고맙습니다.
위의 질문에 대한 제안하십시오 .. – testndtv