문제

I'm currently writing an app that uses Facebook integration built into iOS 6. Now in order to do that, I need to

#import <Social/Social.h>

How do I ensure that the device can actually run the code and won't crash (check if it's iOS 6 or iOS 5.1 and then performing the right code, because I support iOS 5.1<= )?

도움이 되었습니까?

해결책

You could use:

[[UIDevice currentDevice] systemVersion]

다른 팁

This works fine for me:

if(SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"6.0")){
//Use social framework
}else{
//other option
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top