我的应用程序使用以下方法来检测iOS 4和5中的漫游.
NSString *carrierPListSymLinkPath = @"/var/mobile/Library/Preferences/com.apple.carrier.plist";
NSString *operatorPListSymLinkPath = @"/var/mobile/Library/Preferences/com.apple.operator.plist";
NSFileManager *fm = [NSFileManager defaultManager];
NSError *error = nil;
NSString *carrierPListPath = [fm destinationOfSymbolicLinkAtPath:carrierPListSymLinkPath error:&error];
NSString *operatorPListPath = [fm destinationOfSymbolicLinkAtPath:operatorPListSymLinkPath error:&error];
return (![operatorPListPath isEqualToString:carrierPListPath]);
Run Code Online (Sandbox Code Playgroud)
但是这个代码总是在iOS6上返回false(即使我不漫游,它总是返回false),我认为它可能是由Apple更改的plist文件位置,任何人都面临同样的问题,任何人都可以帮助我吗?
谢谢.