My application doesn't open after trying to implement iAds!

0

I have been trying to implement iAds into my application, but this is what happens:

1.Tap on app 2.Loading Screen Displayed for a few seconds 3.App Crashes

This is whats returned:

2010-11-06 20:19:11.043 Vampire Quiz Final[99722:207] Unknown class AdViewController in Interface Builder file. 2010-11-06 20:19:11.066 Vampire Quiz Final[99722:207] -[Vampire_Quiz_FinalViewController setBannerIsVisible:]: unrecognized selector sent to instance 0x761c710 2010-11-06 20:19:11.409 Vampire Quiz Final[99722:207] * Terminating app due to uncaught exception 'NSInvalidArgumentException',

reason: '-[Vampire_Quiz_FinalViewController setBannerIsVisible:]: unrecognized selector sent to instance 0x761c710' * Call stack at first throw: ( 0 CoreFoundation
0x02a88b99 exceptionPreprocess + 185 1 libobjc.A.dylib
0x02bd840e objc_exception_throw + 47 2 CoreFoundation
0x02a8a6ab -[NSObject(NSObject) doesNotRecognizeSelector:] + 187 3
CoreFoundation
0x029fa2b6 __forwarding
+ 966 4
CoreFoundation
0x029f9e72 _CF_forwarding_prep_0 + 50 5 Vampire Quiz Final
0x000027a2 -[Vampire_Quiz_FinalViewController viewDidLoad] + 601 6 UIKit
0x003715ca -[UIViewController view] + 179 7 Vampire Quiz Final
0x000021b1 -[Vampire_Quiz_FinalAppDelegate application:didFinishLaunchingWithOptions:] + 74 8 UIKit 0x002c7f27 -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1163 9 UIKit 0x002ca3b0 -[UIApplication _runWithURL:payload: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 Vampire Quiz Final
0x00002144 main + 102 22 Vampire Quiz Final 0x000020d5 start + 53 ) terminate called after throwing an instance of 'NSException' sharedlibrary apply-load-rules all (gdb)

P.S. I am new to development on the iPhone

Thanks

This is my code :

@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

How can I fix it???

iphone
iad
asked on Stack Overflow Nov 6, 2010 by Simon • edited Nov 6, 2010 by Matthias Bauch

2 Answers

1

you are using self.bannerIsVisible but I can't see neither a synthesize for this nor setters and getters. Did you made a property with bannerIsVisible in your .h file?

To resolve this crash you should define the property in you header and add a @synthesize statement in your implementation.


Maybe you should start with something more basic to get to know the fundamental things like properties, synthesizers, compiler warnings (there should be one), debugging, and so on.
I don't want to be rude, but you won't learn much by using copied code you don't understand.

answered on Stack Overflow Nov 6, 2010 by Matthias Bauch
0

unrecognized selector sent to instance: this means the method for that class is not found. Check the class implementation.

answered on Stack Overflow Nov 6, 2010 by Istvan

User contributions licensed under CC BY-SA 3.0