I implemented Facebook ads in iOS App, Ads is displaying correctly in all device but only crashing into iPad version lower then iOS 8 here i add error and some code for displaying ads.
*** Assertion failure in +[FBScreen sizeInOrientation], /Users/chrisp/src/ios-sdk3/ads/src/FBAudienceNetwork/FBAudienceNetwork/util/FBScreen.m:85 2016-12-02 21:49:22.606 -[__NSCFString containsString:]: unrecognized selector sent to instance 0x160d6150 libc++abi.dylib: terminate_handler unexpectedly threw an exception
Code for Displaying ads.
fbadView = [[FBAdView alloc] initWithPlacementID:@“ID”
adSize:kFBAdSizeHeight50Banner
rootViewController:self];
[fbadView loadAd];
CGSize size = [UIScreen mainScreen].bounds.size;
CGFloat xOffset = size.width / 2 - 150;
fbadView.frame = CGRectMake(xOffset, 10, 300, 50);
[self.mainscrl addSubview:fbadView];
-[__NSCFString containsString:]:
The function containsString
is available in iOS 8 and above. That's why it is raising an exception in iOS 7.
You need to make iOS 8 as your minumum deployment target. Alternatively you can do something like this:
NSString *testString = @"Test";
BOOL containsString = [testString rangeOfString:@"testString"].location != NSNotFound;
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.