我正在尝试检测SIM名称。我曾尝试过这段代码,但它没有用。
-(void)viewDidAppear:(BOOL)animated{
[super viewDidAppear:animated];
NSLog(@"simname = %@", [[CTCarrier alloc]carrierName]);
CTTelephonyNetworkInfo* info = [[CTTelephonyNetworkInfo alloc] init];
CTCarrier* carrier = info.subscriberCellularProvider;
NSString *mobileCountryCode = carrier.mobileCountryCode;
NSString *carrierName = carrier.carrierName;
NSString *isoCountryCode = carrier.isoCountryCode;
NSString *mobileNetworkCode = carrier.mobileNetworkCode;
NSLog(@"simname %@",carrierName);
isPresented = YES;
SelectedClub = -1;
}
OUTPUT显示
2014-05-17 12:54:31.574 xxxx[4302:60b] simname = (null)
2014-05-17 12:54:31.583 xxxx[4302:60b] simname Carrier
更多我想知道苹果是否允许获取SIM名称。