AI-generated Key Takeaways
-
GCKNetworkAddress is an immutable object representing a network IP address.
-
The class provides instance methods to initialize a network address with a type and either an IP address string or raw address data.
-
The default initializer for GCKNetworkAddress is not allowed.
-
Class methods are available to construct specific types of network addresses like wildcard, loopback, IPv4 broadcast, IPv4, IPv6, and IPC addresses.
-
Key properties of GCKNetworkAddress include its type, IP address string, and raw address data.
Overview
An object that represents a network IP address.
This object is immutable.
- Since
- 4.2
Inherits NSObject, <NSCopying>, and <NSSecureCoding>.
Method Detail
| - (instancetype) init |
Using the default initializer is not allowed.
| - (instancetype) initWithType: | (GCKNetworkAddressType) | type | |
| ipAddress: | (nullable NSString *) | ipAddress | |
Constructs a GCKNetworkAddress with the given address type and IP address.
- Parameters
-
type The address type. ipAddress The IP address, in textual form. May be nilto indicate the wildcard ("any") address.
| - (instancetype) initWithType: | (GCKNetworkAddressType) | type | |
| addressData: | (nullable NSData *) | addressData | |
Constructs a GCKNetworkAddress with the given address type and raw address.
- Parameters
-
type The address type. addressData An NSData object containing the appropriate address structure (e.g., struct in_addr or struct in6_addr). For the GCKNNetworkAddressTypeIPC, the data is expected to be a UTF8 encoding.
| + ( GCKNetworkAddress *) wildcardAddressOfType: | (GCKNetworkAddressType) | type |
Constructs a wildcard address of the given type.
| + ( GCKNetworkAddress *) loopbackAddressOfType: | (GCKNetworkAddressType) | type |
Constructs a loopback address of the given type.
| + ( GCKNetworkAddress *) IPv4BroadcastAddress |
Constructs an IPv4 broadcast address.
| + ( GCKNetworkAddress *) addressWithIPv4Address: | (NSString *) | ipAddress |
Constructs an IPv4 address.
| + ( GCKNetworkAddress *) addressWithIPv6Address: | (NSString *) | ipAddress |
Constructs an IPv6 address.
| + ( GCKNetworkAddress *) addressWithIPCPath: | (NSString *) | path |
Constructs an IPC address.
Property Detail
The address type.
The IP address.
The network address as an NSData containing the appropriate address structure (e.g., struct in_addr or struct in6_addr).
For the address type IPC, this field is a UTF8 encoding.

