- (NSString *)getCarrier { NSString *strCarrier = nil; CTTelephonyNetworkInfo *networkInfo = [[CTTelephonyNetworkInfo alloc] init]; CTCarrier *carrier = [networkInfo subscriberCellularProvider]; if (carrier == nil) { [networkInfo release]; return strCarrier; } NSString *code = [carrier mobileNetworkCode]; if (code == nil) { [networkInfo release]; return strCarrier; } // 根據mobileNetworkCode判斷運營商 if ([code isEqualToString:@"00"] || [code isEqualToString:@"02"] || [code isEqualToString:@"07"]) strCarrier = @"中國移動"; else if ([code isEqualToString:@"01"] || [code isEqualToString:@"06"]) strCarrier = @"中國聯通"; else if ([code isEqualToString:@"03"] || [code isEqualToString:@"05"]) strCarrier = @"中國電信"; else if ([code isEqualToString:@"20"]) strCarrier = @"中國鐵通"; else strCarrier = nil; [networkInfo release]; return strCarrier; }