CTCarrier Class Reference

Inherits from
Conforms to
Framework
/System/Library/Frameworks/CoreTelephony.framework/
Availability
Available in iOS 4.0 and later.
Declared in
CTCarrier.h
Related sample code

Overview

Use the CTCarrier class to obtain information about the user’s home cellular service provider, such as its unique identifier and whether or not it allows VoIP (Voice over Internet Protocol) calls on its network.

Tasks

Obtaining Information About the Cellular Service Provider

Properties

allowsVOIP

Indicates if the carrier allows VoIP calls to be made on its network. (read-only)

@property (nonatomic, readonly, assign) BOOL allowsVOIP
Discussion

A read-only Boolean value that is YES if the carrier allows VoIP calls to be made on its network, or NO if not.

If you configure a device for a carrier and then remove the SIM card, this property retains the Boolean value indicating the carrier’s policy regarding VoIP.

Availability
  • Available in iOS 4.0 and later.
Declared In
CTCarrier.h

carrierName

The name of the user’s home cellular service provider. (read-only)

@property (nonatomic, readonly, retain) NSString *carrierName
Discussion

This string is provided by the carrier and formatted for presentation to the user. The value does not change if the user is roaming; it always represents the provider with whom the user has an account.

If you configure a device for a carrier and then remove the SIM card, this property retains the name of the carrier.

The value for this property is nil if the device was never configured for a carrier.

Availability
  • Available in iOS 4.0 and later.
Declared In
CTCarrier.h

isoCountryCode

The ISO country code for the user’s cellular service provider. (read-only)

@property (nonatomic, readonly, retain) NSString *isoCountryCode
Discussion

This property uses the ISO 3166-1 country code representation.

The value for this property is nil if any of the following apply:

  • The device is in Airplane mode.

  • There is no SIM card in the device.

  • The device is outside of cellular service range.

Availability
  • Available in iOS 4.0 and later.
Declared In
CTCarrier.h

mobileCountryCode

The mobile country code (MCC) for the user’s cellular service provider. (read-only)

@property (nonatomic, readonly, retain) NSString *mobileCountryCode
Discussion

A read-only NSString object that contains the numeric mobile country code for the user's cellular service provider. MCCs are defined by ITU-T Recommendation E.212, “List of Mobile Country or Geographical Area Codes.” Typing this property as an NSString object, rather than a number type, ensures that leading zeroes in MCCs are respected.

The value for this property is nil if any of the following apply:

  • There is no SIM card in the device.

  • The device is outside of cellular service range.

The value may be nil on hardware prior to iPhone 4S when in Airplane mode.

Availability
  • Available in iOS 4.0 and later.
Declared In
CTCarrier.h

mobileNetworkCode

The mobile network code (MNC) for the user’s cellular service provider. (read-only)

@property (nonatomic, readonly, retain) NSString *mobileNetworkCode
Discussion

A read-only NSString object that represents the numeric mobile network code for the user’s cellular service provider. Typing this property as an NSString object, rather than a number type, ensures that leading zeroes in MNCs are respected.

The value for this property is nil if any of the following apply:

  • There is no SIM card in the device.

  • The device is outside of cellular service range.

The value may be nil on hardware prior to iPhone 4S when in Airplane mode.

Availability
  • Available in iOS 4.0 and later.
Declared In
CTCarrier.h