Latest iOS SDK failed to compile under Xcode 7.0 beta 5 (7A176x)

ios

#1

Latest iOS SDK 3.11.0 failed to compile under Xcode 7.0 beta 5 (7A176x).
The issue message showed as following.

/MoPub-SDK/MoPubSDK/Internal/MRAID/MRExpandModalViewController.m:81:1: Conflicting return type in implementation of ‘supportedInterfaceOrientations’: ‘UIInterfaceOrientationMask’ (aka ‘enum UIInterfaceOrientationMask’) vs ‘NSUInteger’ (aka ‘unsigned int’)

Is there any branch that supports Xcode 7?


#2

Hello Garyflu1983,

We do not have a MoPub release for iOS 9 yet. Per this Apple forums link here, you can bifurcate based on iOS version.

The associated method in iOS 9 is (UIInterfaceOrientationMask)supportedInterfaceOrientations.

Something like the response at the bottom of the forum chain would work best. What this does is it deals with these methods before compiling and decides which to use. If you are using iOS 8, it will default to the old syntax. If you are using iOS9, it will use the new syntax.

#if __IPHONE_OS_VERSION_MAX_ALLOWED < 90000  
- (NSUInteger)supportedInterfaceOrientations{
	return ([[UIApplication sharedApplication] mp_supportsOrientationMask:self.supportedOrientationMask]) ? self.supportedOrientationMask : UIInterfaceOrientationMaskAll;
}
#else  
- (UIInterfaceOrientationMask)supportedInterfaceOrientations{
	return ([[UIApplication sharedApplication] mp_supportsOrientationMask:self.supportedOrientationMask]) ? self.supportedOrientationMask : UIInterfaceOrientationMaskAll;
}  
#endif

Let me know if this works for you.

Thanks!