我一直在努力实现的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