我一直在努力實現的iAds到我的應用程序,但是這是發生了什麼:嘗試實施iAd後,我的應用程序無法打開!
上應用 2.Loading屏幕顯示1.Tap了幾秒鐘 3.App崩潰
這是什麼返回:
2010-11-06 20:19:11.043吸血鬼測驗 最終[99722:207]未知類 AdViewController在界面生成器 文件。 2010-11-06 20:19:11.066吸血鬼 測驗最終[99722:207] - [Vampire_Quiz_FinalViewController setBannerIsVisible:]:無法識別 選擇發送到實例0x761c710 2010-11-06 20:19:11.409吸血鬼測驗 最終[ 99722:207] *終止應用程序 由於未捕獲的異常 'NSInvalidArgumentException' 的,
原因: ' - [Vampire_Quiz_FinalViewController setBannerIsVisible:]:無法識別 選擇發送到實例0x761c710' *鈣(0 CoreFoundation
0x02a88b99 exceptionPreprocess + 185 1 libobjc.A。dylib
0x02bd840e objc_exception_throw + 47 2的CoreFoundation
0x02a8a6ab - [NSObject的(NSObject的) doesNotRecognizeSelector:] + 187 3
的CoreFoundation
0x029fa2b6 __ 轉發 + 966 4
的CoreFoundation
0x029f9e72 _CF_forwarding_prep_0 + 50 5 Vampire Quiz Final
0x000027a2 - [Vampire_Quiz_FinalViewController viewDidLoad] + 601 6 UIKit
0x003715ca - [UIViewController的視圖] + 179 7吸血鬼測驗最終
0x000021b1 - [Vampire_Quiz_FinalAppDelegate應用中:didFinishLaunchingWithOptions:] + 74 8的UIKit 0x002c7f27 - [UIApplication的 _callInitializationDelegatesForURL:有效載荷:懸浮:] + 1163 9的UIKit 0x002ca3b0 - [UIApplication的 _runWithURL:有效載荷:launchOrientation:statusBarStyle:statusBarHidden:] + 346 10的UIKit 0x002d43ec - [UIApplication的 的handleEvent:withNewEvent:] + 1958 11 的UIKit
0x002ccb3c - [UIApplication的的SendEvent:] + 71 12的UIKit 0x002d19bf _UIApplicationHandleEvent + 7672 13 GraphicsServices
0x03368822 PurpleEventCallback + 1550 14的CoreFoundation
0x02a69ff4 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION + 52 15的CoreFoundation 0x029ca807 __CFRunLoopDoSource1 + 215 16的CoreFoundation
0x029c7a93 __CFRunLoopRun + 979 17 的CoreFoundation
0x029c7350 CFRunLoopRunSpecific + 208 18 CoreFoundation
0x029c7271 CFRunLoopRunInMode + 97 19 的UIKit
0x002c9c6d - [UIApplication的_run] + 625 20的UIKit
0x002d5af2 UIApplicationMain + 1160 21吸血鬼測驗最終
0x00002144主+ 102 22吸血鬼 測驗最終0x000020d5 啓動+ 53)終止稱爲 拋出實例後的 'NSException' sharedlibrary施加的負載規則所有 (GDB)
PS我是新開發的iPhone
感謝
這是我的代碼:
@implementation Vampire_Quiz_FinalViewController
- (IBAction)V;
{
Vork *V = [[Vork alloc] initWithNibName:nil bundle:nil];
[self presentModalViewController:V animated:NO];
}
- (IBAction)A;
{
About *A = [[About alloc] initWithNibName:nil bundle:nil];
[self presentModalViewController:A animated:NO];
}
- (IBAction)I;
{
Instructions *I = [[Instructions alloc] initWithNibName:nil bundle:nil];
[self presentModalViewController:I animated:NO];
}
- (void)dealloc {
[super dealloc];
}
- (void)viewDidLoad {
adView = [[ADBannerView alloc] initWithFrame:CGRectZero];
adView.frame = CGRectOffset(adView.frame, 0, -50);
adView.requiredContentSizeIdentifiers = [NSSet setWithObject:ADBannerContentSizeIdentifier320x50];
adView.currentContentSizeIdentifier = ADBannerContentSizeIdentifier320x50;
[self.view addSubview:adView];
adView.delegate=self;
self.bannerIsVisible=NO;
[super viewDidLoad];
}
- (void)bannerViewDidLoadAd:(ADBannerView *)banner
{
if (!self.bannerIsVisible)
{
[UIView beginAnimations:@"animateAdBannerOn" context:NULL];
// banner is invisible now and moved out of the screen on 50 px
banner.frame = CGRectOffset(banner.frame, 0, 50);
[UIView commitAnimations];
self.bannerIsVisible = YES;
}
}
- (void)bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error
{
if (self.bannerIsVisible)
{
[UIView beginAnimations:@"animateAdBannerOff" context:NULL];
// banner is visible and we move it out of the screen, due to connection issue
banner.frame = CGRectOffset(banner.frame, 0, -50);
[UIView commitAnimations];
self.bannerIsVisible = NO;
}
}
@end
我怎樣才能解決這個問題???
感謝您的幫助! – Simon 2010-11-06 09:56:23
是的我在.h文件中創建了一個屬性 – Simon 2010-11-06 09:58:17
#import #import ; @interface Vampire_Quiz_FinalViewController:的UIViewController { \t ADBannerView * AD瀏覽; \t BOOL bannerIsVisible; } @property(nonatomic,assign)BOOL bannerIsVisible; (IBAction)V; - (IBAction)V; (IBAction)A; - (IBAction)A; - (IBAction)I; @end –
Simon
2010-11-06 09:58:32