您的位置:首页 > 移动开发 > IOS开发

关于IOS6的适配问题

2015-10-09 16:50 375 查看
现在大部分使用AFNetworing开源库的应用大部分是无法支持IOS6的,是因为在AFNetworking2.0 之后的版本使用了IOS6之后弃用的方法。如果要适配IOS6 除了其他方法外,需要改动网络开源库,比如将AFNetworing 改到2.0 (包括)之前的版本,或者使用ASI做网络请求部分,不过最好对每个系统版本做出判断,然后处理部分系统版本.例如

#define IOS8_OR_LATER ( [[[UIDevice currentDevice] systemVersion] compare:@"8.0"] != NSOrderedAscending )
#define IOS7_OR_LATER ( [[[UIDevice currentDevice] systemVersion] compare:@"7.0"] != NSOrderedAscending )
#define IOS6_OR_LATER ( [[[UIDevice currentDevice] systemVersion] compare:@"6.0"] != NSOrderedAscending )
#define IOS5_OR_LATER ( [[[UIDevice currentDevice] systemVersion] compare:@"5.0"] != NSOrderedAscending )
#define IOS4_OR_LATER ( [[[UIDevice currentDevice] systemVersion] compare:@"4.0"] != NSOrderedAscending )
#define IOS3_OR_LATER ( [[[UIDevice currentDevice] systemVersion] compare:@"3.0"] != NSOrderedAscending )

#define IS_IPAD         (UI_USER_INTERFACE_IDIOM()==UIUserInterfaceIdiomPad)
#define IS_IPHONE_5     [SNSystemInfo is_iPhone_5];

对每个系统版本做出判断然后处理在特殊版本下的网络情况
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  ios开发 ios 6