My application worked well until then I added admob frameworkand now it crashes.
Please check the crash logs,

I tried on Google, but there is no result in this crash.
If I commented on the contents inside viewDidAppear(), then the application is working (without downloading part of the application). But if I try to download "admob", then its crash.
The code:
-(void)viewDidAppear:(BOOL)animated{
if([Connectivity hasConnectivity]){
NSTimer* myTimer = [NSTimer scheduledTimerWithTimeInterval: 15.0 target: self
selector: @selector(callAfterSixtySecond:) userInfo: nil repeats: YES];
}
}
-(void) callAfterSixtySecond:(NSTimer*) t
{
if([GMMConnectivity hasConnectivity]){
[self.adBanner removeFromSuperview];
[self loadAdmob];
}
}
-(void)loadAdmob{
CGPoint origin;
if(IS_RETINA){
if([[UIScreen mainScreen] bounds].size.height >500){
origin = CGPointMake(0.0,
568-
CGSizeFromGADAdSize(kGADAdSizeSmartBannerPortrait).height);
}else{
origin = CGPointMake(0.0,
(480)-
CGSizeFromGADAdSize(kGADAdSizeSmartBannerPortrait).height);
}
}else{
origin = CGPointMake(0.0,
(460)-
CGSizeFromGADAdSize(kGADAdSizeSmartBannerPortrait).height);
}
self.adBanner = [[GADBannerView alloc] initWithAdSize:kGADAdSizeSmartBannerPortrait
origin:origin]
;
self.adBanner.adUnitID = MY_BANNER_UNIT_ID;
self.adBanner.delegate = self;
[self.adBanner setRootViewController:self];
[self.view addSubview:self.adBanner];
self.adBanner.center =
CGPointMake(self.view.center.x, self.adBanner.center.y);
[self.adBanner loadRequest:[self createRequest]];
[self.view addSubview:adBanner_];
}
source
share