Foundation Constants Reference
| Framework | Foundation/Foundation.h |
| Declared in | FoundationErrors.h NSByteOrder.h NSDecimal.h NSError.h NSException.h NSObjCRuntime.h NSPathUtilities.h NSURLError.h |
Overview
This document defines constants in the Foundation framework that are not associated with a particular class.
Constants
Enumerations
NSByteOrder
Specifies an byte-order format.
enum _NSByteOrder {
NS_UnknownByteOrder = CFByteOrderUnknown,
NS_LittleEndian = CFByteOrderLittleEndian,
NS_BigEndian = CFByteOrderBigEndian
};
Constants
NS_UnknownByteOrderThe byte order is unknown.
Available in iOS 2.0 and later.
Declared in
NSByteOrder.h.NS_LittleEndianThe byte order is little endian.
Available in iOS 2.0 and later.
Declared in
NSByteOrder.h.NS_BigEndianThe byte order is big endian.
Available in iOS 2.0 and later.
Declared in
NSByteOrder.h.
Discussion
These constants are returned by NSHostByteOrder.
NSNotFound
Defines a value that indicates that an item requested couldn’t be found or doesn’t exist.
enum {
NSNotFound = NSIntegerMax
};
Constants
NSNotFoundA value that indicates that an item requested couldn’t be found or doesn’t exist.
Available in iOS 2.0 and later.
Declared in
NSObjCRuntime.h.
Discussion
NSNotFound is typically used by various methods and functions that search for items in serial data and return indices, such as characters in a string object or ids in an NSArray object.
Special Considerations
Prior to OS X v10.5, NSNotFound was defined as 0x7fffffff. For 32-bit systems, this was effectively the same as NSIntegerMax. To support 64-bit environments, NSNotFound is now formally defined as NSIntegerMax. This means, however, that the value is different in 32-bit and 64-bit environments. You should therefore not save the value directly in files or archives. Moreover, sending the value between 32-bit and 64-bit processes via Distributed Objects will not get you NSNotFound on the other side. This applies to any Cocoa methods invoked over Distributed Objects and which might return NSNotFound, such as the indexOfObject: method of NSArray (if sent to a proxy for an array).
NSEnumerationOptions
Options for Block enumeration operations.
enum {
NSEnumerationConcurrent = (1UL << 0),
NSEnumerationReverse = (1UL << 1),
};
typedef NSUInteger NSEnumerationOptions;
Constants
NSEnumerationConcurrentSpecifies that the Block enumeration should be concurrent.
The order of invocation is nondeterministic and undefined; this flag is a hint and may be ignored by the implementation under some circumstances; the code of the Block must be safe against concurrent invocation.
Available in iOS 4.0 and later.
Declared in
NSObjCRuntime.h.NSEnumerationReverseSpecifies that the enumeration should be performed in reverse.
This option is available for
NSArrayandNSIndexSetclasses; its behavior is undefined forNSDictionaryandNSSetclasses, or when combined with theNSEnumerationConcurrentflag.Available in iOS 4.0 and later.
Declared in
NSObjCRuntime.h.
Declared In
NSObjCRuntime.hNSComparisonResult
These constants are used to indicate how items in a request are ordered.
enum {
NSOrderedAscending = -1,
NSOrderedSame,
NSOrderedDescending
};
typedef NSInteger NSComparisonResult;
Constants
NSOrderedAscendingThe left operand is smaller than the right operand.
Available in iOS 2.0 and later.
Declared in
NSObjCRuntime.h.NSOrderedSameThe two operands are equal.
Available in iOS 2.0 and later.
Declared in
NSObjCRuntime.h.NSOrderedDescendingThe left operand is greater than the right operand.
Available in iOS 2.0 and later.
Declared in
NSObjCRuntime.h.
Discussion
These constants are used to indicate how items in a request are ordered, from the first one given in a method invocation or function call to the last (that is, left to right in code).
NSSortOptions
Options for Block sorting operations.
enum {
NSSortConcurrent = (1UL << 0),
NSSortStable = (1UL << 4),
};
typedef NSUInteger NSSortOptions;
Constants
NSSortConcurrentSpecifies that the Block sort operation should be concurrent.
This option is a hint and may be ignored by the implementation under some circumstances; the code of the Block must be safe against concurrent invocation.
Available in iOS 4.0 and later.
Declared in
NSObjCRuntime.h.NSSortStableSpecifies that the sorted results should return compared items have equal value in the order they occurred originally.
If this option is unspecified equal objects may, or may not, be returned in their original order.
Available in iOS 4.0 and later.
Declared in
NSObjCRuntime.h.
Declared In
NSObjCRuntime.hNSSearchPathDirectory
These constants specify the location of a variety of directories by the URLsForDirectory:inDomains: and URLForDirectory:inDomain:appropriateForURL:create:error: NSFileManager methods.
enum {
NSApplicationDirectory = 1,
NSDemoApplicationDirectory,
NSDeveloperApplicationDirectory,
NSAdminApplicationDirectory,
NSLibraryDirectory,
NSDeveloperDirectory,
NSUserDirectory,
NSDocumentationDirectory,
NSDocumentDirectory,
NSCoreServiceDirectory,
NSAutosavedInformationDirectory = 11,
NSDesktopDirectory = 12,
NSCachesDirectory = 13,
NSApplicationSupportDirectory = 14,
NSDownloadsDirectory = 15,
NSInputMethodsDirectory = 16,
NSMoviesDirectory = 17,
NSMusicDirectory = 18,
NSPicturesDirectory = 19,
NSPrinterDescriptionDirectory = 20,
NSSharedPublicDirectory = 21,
NSPreferencePanesDirectory = 22,
NSApplicationScriptsDirectory = 23,
NSItemReplacementDirectory = 99,
NSAllApplicationsDirectory = 100,
NSAllLibrariesDirectory = 101,
NSTrashDirectory = 102
};
typedef NSUInteger NSSearchPathDirectory;
Constants
NSApplicationDirectorySupported applications (
/Applications).Available in iOS 2.0 and later.
Declared in
NSPathUtilities.h.NSDemoApplicationDirectoryUnsupported applications and demonstration versions.
Available in iOS 2.0 and later.
Declared in
NSPathUtilities.h.NSDeveloperApplicationDirectoryDeveloper applications (
/Developer/Applications).Deprecated: As of Xcode 4.3, there is no longer a Developer Application directory directory; instead, Xcode.app is a self-contained application that gets installed in the user’s Applications directory, by default, although it can be put anywhere.
Available in iOS 2.0 and later.
Declared in
NSPathUtilities.h.NSAdminApplicationDirectorySystem and network administration applications.
Available in iOS 2.0 and later.
Declared in
NSPathUtilities.h.NSLibraryDirectoryVarious user-visible documentation, support, and configuration files (
/Library).Available in iOS 2.0 and later.
Declared in
NSPathUtilities.h.NSDeveloperDirectoryDeveloper resources (
/Developer).Deprecated: As of Xcode 4.3, there is no longer a Developer directory; instead, Xcode.app is a self-contained application that gets installed in the user’s Applications directory, by default, although it can be put anywhere.
Available in iOS 2.0 and later.
Declared in
NSPathUtilities.h.NSUserDirectoryUser home directories (
/Users).Available in iOS 2.0 and later.
Declared in
NSPathUtilities.h.NSDocumentationDirectoryDocumentation.
Available in iOS 2.0 and later.
Declared in
NSPathUtilities.h.NSDocumentDirectoryDocument directory.
Available in iOS 2.0 and later.
Declared in
NSPathUtilities.h.NSCoreServiceDirectoryLocation of core services (
System/Library/CoreServices).Available in iOS 2.0 and later.
Declared in
NSPathUtilities.h.NSAutosavedInformationDirectoryLocation of user’s autosaved documents
Library/Autosave InformationAvailable in iOS 4.0 and later.
Declared in
NSPathUtilities.h.NSDesktopDirectoryLocation of user’s desktop directory.
Available in iOS 2.0 and later.
Declared in
NSPathUtilities.h.NSCachesDirectoryLocation of discardable cache files (
Library/Caches).Available in iOS 2.0 and later.
Declared in
NSPathUtilities.h.NSApplicationSupportDirectoryLocation of application support files (
Library/Application Support).Available in iOS 2.0 and later.
Declared in
NSPathUtilities.h.NSDownloadsDirectoryLocation of the user’s downloads directory.
The
NSDownloadsDirectoryflag will only produce a path only when theNSUserDomainMaskis provided.Available in iOS 2.0 and later.
Declared in
NSPathUtilities.h.NSInputMethodsDirectoryLocation of Input Methods (Library/Input Methods)
Available in iOS 4.0 and later.
Declared in
NSPathUtilities.h.NSMoviesDirectoryLocation of user's Movies directory
(~/Movies)Available in iOS 4.0 and later.
Declared in
NSPathUtilities.h.NSMusicDirectoryLocation of user's Music directory (
~/Music)Available in iOS 4.0 and later.
Declared in
NSPathUtilities.h.NSPicturesDirectoryLocation of user's Pictures directory (
~/Pictures)Available in iOS 4.0 and later.
Declared in
NSPathUtilities.h.NSPrinterDescriptionDirectoryLocation of system's PPDs directory (
Library/Printers/PPDs)Available in iOS 4.0 and later.
Declared in
NSPathUtilities.h.NSSharedPublicDirectoryLocation of user's Public sharing directory (
~/Public)Available in iOS 4.0 and later.
Declared in
NSPathUtilities.h.NSPreferencePanesDirectoryLocation of the PreferencePanes directory for use with System Preferences (
Library/PreferencePanes)Available in iOS 4.0 and later.
Declared in
NSPathUtilities.h.NSApplicationScriptsDirectoryLocation of the user scripts folder for the calling application (
~/Library/Application Scripts/<code-signing-id>Available in iOS 6.0 and later.
Declared in
NSPathUtilities.h.NSItemReplacementDirectoryFor use with
NSFileManagermethodURLForDirectory:inDomain:appropriateForURL:create:error:Available in iOS 4.0 and later.
Declared in
NSPathUtilities.h.NSAllApplicationsDirectoryAll directories where applications can occur.
Available in iOS 2.0 and later.
Declared in
NSPathUtilities.h.NSAllLibrariesDirectoryAll directories where resources can occur.
Available in iOS 2.0 and later.
Declared in
NSPathUtilities.h.NSTrashDirectoryLocation of the trash directory.
Available in iOS 6.0 and later.
Declared in
NSPathUtilities.h.
NSSearchPathDomainMask
Search path domain constants specifying base locations for the NSSearchPathDirectory type. These constants are used by the URLsForDirectory:inDomains: and URLForDirectory:inDomain:appropriateForURL:create:error: NSFileManager methods.
enum {
NSUserDomainMask = 1,
NSLocalDomainMask = 2,
NSNetworkDomainMask = 4,
NSSystemDomainMask = 8,
NSAllDomainsMask = 0x0ffff,
};
typedef NSUInteger NSSearchPathDomainMask;
Constants
NSUserDomainMaskThe user’s home directory—the place to install user’s personal items (
~).Available in iOS 2.0 and later.
Declared in
NSPathUtilities.h.NSLocalDomainMaskLocal to the current machine—the place to install items available to everyone on this machine.
Available in iOS 2.0 and later.
Declared in
NSPathUtilities.h.NSNetworkDomainMaskPublicly available location in the local area network—the place to install items available on the network (
/Network).Available in iOS 2.0 and later.
Declared in
NSPathUtilities.h.NSSystemDomainMaskProvided by Apple—can’t be modified (
/System) .Available in iOS 2.0 and later.
Declared in
NSPathUtilities.h.NSAllDomainsMaskAll domains.
Includes all of the above and future items.
Available in iOS 2.0 and later.
Declared in
NSPathUtilities.h.
Declared In
NSPathUtilities.hNSError Codes
NSError codes in the Cocoa error domain.
enum {
NSFileNoSuchFileError = 4,
NSFileLockingError = 255,
NSFileReadUnknownError = 256,
NSFileReadNoPermissionError = 257,
NSFileReadInvalidFileNameError = 258,
NSFileReadCorruptFileError = 259,
NSFileReadNoSuchFileError = 260,
NSFileReadInapplicableStringEncodingError = 261,
NSFileReadUnsupportedSchemeError = 262,
NSFileReadTooLargeError = 263,
NSFileReadUnknownStringEncodingError = 264,
NSFileWriteUnknownError = 512,
NSFileWriteNoPermissionError = 513,
NSFileWriteInvalidFileNameError = 514,
NSFileWriteFileExistsError = 516,
NSFileWriteInapplicableStringEncodingError = 517,
NSFileWriteUnsupportedSchemeError = 518,
NSFileWriteOutOfSpaceError = 640,
NSFileWriteVolumeReadOnlyError = 642,
NSKeyValueValidationError = 1024,
NSFormattingError = 2048,
NSUserCancelledError = 3072,
NSFileErrorMinimum = 0,
NSFileErrorMaximum = 1023,
NSValidationErrorMinimum = 1024,
NSValidationErrorMaximum = 2047,
NSFormattingErrorMinimum = 2048,
NSFormattingErrorMaximum = 2559,
NSPropertyListReadCorruptError = 3840,
NSPropertyListReadUnknownVersionError = 3841,
NSPropertyListReadStreamError = 3842,
NSPropertyListWriteStreamError = 3851,
NSPropertyListErrorMinimum = 3840,
NSPropertyListErrorMaximum = 4095
NSExecutableErrorMinimum = 3584,
NSExecutableNotLoadableError = 3584,
NSExecutableArchitectureMismatchError = 3585,
NSExecutableRuntimeMismatchError = 3586,
NSExecutableLoadError = 3587,
NSExecutableLinkError = 3588,
NSExecutableErrorMaximum = 3839,
}
Constants
NSFileNoSuchFileErrorFile-system operation attempted on non-existent file
Available in iOS 2.0 and later.
Declared in
FoundationErrors.h.NSFileLockingErrorFailure to get a lock on file
Available in iOS 2.0 and later.
Declared in
FoundationErrors.h.NSFileReadUnknownErrorRead error, reason unknown
Available in iOS 2.0 and later.
Declared in
FoundationErrors.h.NSFileReadNoPermissionErrorRead error because of a permission problem
Available in iOS 2.0 and later.
Declared in
FoundationErrors.h.NSFileReadInvalidFileNameErrorRead error because of an invalid file name
Available in iOS 2.0 and later.
Declared in
FoundationErrors.h.NSFileReadCorruptFileErrorRead error because of a corrupted file, bad format, or similar reason
Available in iOS 2.0 and later.
Declared in
FoundationErrors.h.NSFileReadNoSuchFileErrorRead error because no such file was found
Available in iOS 2.0 and later.
Declared in
FoundationErrors.h.NSFileReadInapplicableStringEncodingErrorRead error because the string encoding was not applicable.
Access the bad encoding from the
userInfodictionary using theNSStringEncodingErrorKeykey.Available in iOS 2.0 and later.
Declared in
FoundationErrors.h.NSFileReadUnsupportedSchemeErrorRead error because the specified URL scheme is unsupported
Available in iOS 2.0 and later.
Declared in
FoundationErrors.h.NSFileReadTooLargeErrorRead error because the specified file was too large.
Available in iOS 2.0 and later.
Declared in
FoundationErrors.h.NSFileReadUnknownStringEncodingErrorRead error because the string coding of the file could not be determined
Available in iOS 2.0 and later.
Declared in
FoundationErrors.h.NSFileWriteUnknownErrorWrite error, reason unknown
Available in iOS 2.0 and later.
Declared in
FoundationErrors.h.NSFileWriteNoPermissionErrorWrite error because of a permission problem
Available in iOS 2.0 and later.
Declared in
FoundationErrors.h.NSFileWriteInvalidFileNameErrorWrite error because of an invalid file name
Available in iOS 2.0 and later.
Declared in
FoundationErrors.h.NSFileWriteFileExistsErrorWrite error returned when NSFileManager class’s copy, move, and link methods report errors when the destination file already exists.
Available in iOS 5.0 and later.
Declared in
FoundationErrors.h.NSFileWriteInapplicableStringEncodingErrorWrite error because the string encoding was not applicable.
Access the bad encoding from the
userInfodictionary using theNSStringEncodingErrorKeykey.Available in iOS 2.0 and later.
Declared in
FoundationErrors.h.NSFileWriteUnsupportedSchemeErrorWrite error because the specified URL scheme is unsupported
Available in iOS 2.0 and later.
Declared in
FoundationErrors.h.NSFileWriteOutOfSpaceErrorWrite error because of a lack of disk space
Available in iOS 2.0 and later.
Declared in
FoundationErrors.h.NSFileWriteVolumeReadOnlyErrorWrite error because because the volume is read only.
Available in iOS 4.0 and later.
Declared in
FoundationErrors.h.NSKeyValueValidationErrorKey-value coding validation error
Available in iOS 2.0 and later.
Declared in
FoundationErrors.h.NSFormattingErrorFormatting error (related to display of data)
Available in iOS 2.0 and later.
Declared in
FoundationErrors.h.NSUserCancelledErrorThe user cancelled the operation (for example, by pressing Command-period).
This code is for errors that do not require a dialog displayed and might be candidates for special-casing.
Available in iOS 2.0 and later.
Declared in
FoundationErrors.h.NSFileErrorMinimumMarks the start of the range of error codes reserved for file errors
Available in iOS 2.0 and later.
Declared in
FoundationErrors.h.NSFileErrorMaximumMarks the end of the range of error codes reserved for file errors
Available in iOS 2.0 and later.
Declared in
FoundationErrors.h.NSValidationErrorMinimumMarks the start of the range of error codes reserved for validation errors.
Available in iOS 2.0 and later.
Declared in
FoundationErrors.h.NSValidationErrorMaximumMarks the start and end of the range of error codes reserved for validation errors.
Available in iOS 2.0 and later.
Declared in
FoundationErrors.h.NSFormattingErrorMinimumMarks the start of the range of error codes reserved for formatting errors.
Available in iOS 2.0 and later.
Declared in
FoundationErrors.h.NSFormattingErrorMaximumMarks end of the range of error codes reserved for formatting errors.
Available in iOS 2.0 and later.
Declared in
FoundationErrors.h.NSPropertyListReadCorruptErrorAn error was encountered while parsing the property list.
Available in iOS 4.0 and later.
Declared in
FoundationErrors.h.NSPropertyListReadUnknownVersionErrorThe version number of the property list is unable to be determined.
Available in iOS 4.0 and later.
Declared in
FoundationErrors.h.NSPropertyListReadStreamErrorAn stream error was encountered while reading the property list.
Available in iOS 4.0 and later.
Declared in
FoundationErrors.h.NSPropertyListWriteStreamErrorAn stream error was encountered while writing the property list.
Available in iOS 4.0 and later.
Declared in
FoundationErrors.h.NSPropertyListErrorMinimumMarks beginning of the range of error codes reserved for property list errors.
Available in iOS 4.0 and later.
Declared in
FoundationErrors.h.NSPropertyListErrorMaximumMarks end of the range of error codes reserved for property list errors.
Available in iOS 4.0 and later.
Declared in
FoundationErrors.h.NSExecutableErrorMinimumMarks beginning of the range of error codes reserved for errors related to executable files.
Available in iOS 2.0 and later.
Declared in
FoundationErrors.h.NSExecutableNotLoadableErrorExecutable is of a type that is not loadable in the current process.
Available in iOS 2.0 and later.
Declared in
FoundationErrors.h.NSExecutableArchitectureMismatchErrorExecutable does not provide an architecture compatible with the current process.
Available in iOS 2.0 and later.
Declared in
FoundationErrors.h.NSExecutableRuntimeMismatchErrorExecutable has Objective C runtime information incompatible with the current process.
Available in iOS 2.0 and later.
Declared in
FoundationErrors.h.NSExecutableLoadErrorExecutable cannot be loaded for some other reason, such as a problem with a library it depends on.
Available in iOS 2.0 and later.
Declared in
FoundationErrors.h.NSExecutableLinkErrorExecutable fails due to linking issues.
Available in iOS 2.0 and later.
Declared in
FoundationErrors.h.NSExecutableErrorMaximumMarks end of the range of error codes reserved for errors related to executable files.
Available in iOS 2.0 and later.
Declared in
FoundationErrors.h.
Discussion
The constants in this enumeration are NSError code numbers in the Cocoa error domain (NSCocoaErrorDomain). Other frameworks, most notably the Application Kit, provide their own NSCocoaErrorDomain error codes.
The enumeration constants beginning with NSFile indicate file-system errors or errors related to file I/O operations. Use the key NSFilePathErrorKey or the NSURLErrorKey (whichever is appropriate) to access the file-system path or URL in the userInfo dictionary of the NSError object.
Declared In
FoundationErrors.hURL Loading System Error Codes
These values are returned as the error code property of an NSError object with the domain “NSURLErrorDomain”.
enum
{
NSURLErrorUnknown = -1,
NSURLErrorCancelled = -999,
NSURLErrorBadURL = -1000,
NSURLErrorTimedOut = -1001,
NSURLErrorUnsupportedURL = -1002,
NSURLErrorCannotFindHost = -1003,
NSURLErrorCannotConnectToHost = -1004,
NSURLErrorDataLengthExceedsMaximum = -1103,
NSURLErrorNetworkConnectionLost = -1005,
NSURLErrorDNSLookupFailed = -1006,
NSURLErrorHTTPTooManyRedirects = -1007,
NSURLErrorResourceUnavailable = -1008,
NSURLErrorNotConnectedToInternet = -1009,
NSURLErrorRedirectToNonExistentLocation = -1010,
NSURLErrorBadServerResponse = -1011,
NSURLErrorUserCancelledAuthentication = -1012,
NSURLErrorUserAuthenticationRequired = -1013,
NSURLErrorZeroByteResource = -1014,
NSURLErrorCannotDecodeRawData = -1015,
NSURLErrorCannotDecodeContentData = -1016,
NSURLErrorCannotParseResponse = -1017,
NSURLErrorInternationalRoamingOff = -1018,
NSURLErrorCallIsActive = -1019,
NSURLErrorDataNotAllowed = -1020,
NSURLErrorRequestBodyStreamExhausted = -1021,
NSURLErrorFileDoesNotExist = -1100,
NSURLErrorFileIsDirectory = -1101,
NSURLErrorNoPermissionsToReadFile = -1102,
NSURLErrorSecureConnectionFailed = -1200,
NSURLErrorServerCertificateHasBadDate = -1201,
NSURLErrorServerCertificateUntrusted = -1202,
NSURLErrorServerCertificateHasUnknownRoot = -1203,
NSURLErrorServerCertificateNotYetValid = -1204,
NSURLErrorClientCertificateRejected = -1205,
NSURLErrorClientCertificateRequired = -1206,
NSURLErrorCannotLoadFromNetwork = -2000,
NSURLErrorCannotCreateFile = -3000,
NSURLErrorCannotOpenFile = -3001,
NSURLErrorCannotCloseFile = -3002,
NSURLErrorCannotWriteToFile = -3003,
NSURLErrorCannotRemoveFile = -3004,
NSURLErrorCannotMoveFile = -3005,
NSURLErrorDownloadDecodingFailedMidStream = -3006,
NSURLErrorDownloadDecodingFailedToComplete = -3007
}
Constants
NSURLErrorUnknownReturned when the URL Loading system encounters an error that it cannot interpret.
This can occur when an error originates from a lower level framework or library. Whenever this error code is received, it is a bug, and should be reported to Apple.
Available in iOS 2.0 and later.
Declared in
NSURLError.h.NSURLErrorCancelledReturned when an asynchronous load is canceled.
A Web Kit framework delegate will receive this error when it performs a cancel operation on a loading resource. Note that an
NSURLConnectionorNSURLDownloaddelegate will not receive this error if the download is canceled.Available in iOS 2.0 and later.
Declared in
NSURLError.h.NSURLErrorBadURLReturned when a URL is sufficiently malformed that a URL request cannot be initiated
Available in iOS 2.0 and later.
Declared in
NSURLError.h.NSURLErrorTimedOutReturned when an asynchronous operation times out.
NSURLConnectionwill send this error to its delegate when the timeoutInterval in NSURLRequest expires before a load can complete.Available in iOS 2.0 and later.
Declared in
NSURLError.h.NSURLErrorUnsupportedURLReturned when a properly formed URL cannot be handled by the framework.
The most likely cause is that there is no available protocol handler for the URL.
Available in iOS 2.0 and later.
Declared in
NSURLError.h.NSURLErrorCannotFindHostReturned when the host name for a URL cannot be resolved.
Available in iOS 2.0 and later.
Declared in
NSURLError.h.NSURLErrorCannotConnectToHostReturned when an attempt to connect to a host has failed.
This can occur when a host name resolves, but the host is down or may not be accepting connections on a certain port.
Available in iOS 2.0 and later.
Declared in
NSURLError.h.NSURLErrorDataLengthExceedsMaximumReturned when the length of the resource data exceeds the maximum allowed.
Available in iOS 2.0 and later.
Declared in
NSURLError.h.NSURLErrorNetworkConnectionLostReturned when a client or server connection is severed in the middle of an in-progress load.
Available in iOS 2.0 and later.
Declared in
NSURLError.h.NSURLErrorDNSLookupFailedSee
NSURLErrorCannotFindHostAvailable in iOS 2.0 and later.
Declared in
NSURLError.h.NSURLErrorHTTPTooManyRedirectsReturned when a redirect loop is detected or when the threshold for number of allowable redirects has been exceeded (currently 16).
Available in iOS 2.0 and later.
Declared in
NSURLError.h.NSURLErrorResourceUnavailableReturned when a requested resource cannot be retrieved.
Examples are “file not found”, and data decoding problems that prevent data from being processed correctly.
Available in iOS 2.0 and later.
Declared in
NSURLError.h.NSURLErrorNotConnectedToInternetReturned when a network resource was requested, but an internet connection is not established and cannot be established automatically, either through a lack of connectivity, or by the user's choice not to make a network connection automatically.
Available in iOS 2.0 and later.
Declared in
NSURLError.h.NSURLErrorRedirectToNonExistentLocationReturned when a redirect is specified by way of server response code, but the server does not accompany this code with a redirect URL.
Available in iOS 2.0 and later.
Declared in
NSURLError.h.NSURLErrorBadServerResponseReturned when the URL Loading system receives bad data from the server.
This is equivalent to the “500 Server Error” message sent by HTTP servers.
Available in iOS 2.0 and later.
Declared in
NSURLError.h.NSURLErrorUserCancelledAuthenticationReturned when an asynchronous request for authentication is cancelled by the user.
This is typically incurred by clicking a “Cancel” button in a username/password dialog, rather than the user making an attempt to authenticate.
Available in iOS 2.0 and later.
Declared in
NSURLError.h.NSURLErrorUserAuthenticationRequiredReturned when authentication is required to access a resource.
Available in iOS 2.0 and later.
Declared in
NSURLError.h.NSURLErrorZeroByteResourceReturned when a server reports that a URL has a non-zero content length, but terminates the network connection “gracefully” without sending any data.
Available in iOS 2.0 and later.
Declared in
NSURLError.h.NSURLErrorCannotDecodeRawDataReturned when content data received during an NSURLConnection request cannot be decoded for a known content encoding.
Available in iOS 2.0 and later.
Declared in
NSURLError.h.NSURLErrorCannotDecodeContentDataReturned when content data received during an NSURLConnection request has an unknown content encoding.
Available in iOS 2.0 and later.
Declared in
NSURLError.h.NSURLErrorCannotParseResponseReturned when a response to an NSURLConnection request cannot be parsed.
Available in iOS 2.0 and later.
Declared in
NSURLError.h.NSURLErrorInternationalRoamingOffReturned when a connection would require activating a data context while roaming, but international roaming is disabled.
Available in iOS 3.0 and later.
Declared in
NSURLError.h.NSURLErrorCallIsActiveReturned when a connection is attempted while a phone call is active on a network that does not support simultaneous phone and data communication (EDGE or GPRS).
Available in iOS 3.0 and later.
Declared in
NSURLError.h.NSURLErrorDataNotAllowedReturned when the cellular network disallows a connection.
Available in iOS 3.0 and later.
Declared in
NSURLError.h.NSURLErrorRequestBodyStreamExhaustedReturned when a body stream is needed but the client does not provide one. This impacts clients on iOS that send a POST request using a body stream but do not implement the NSURLConnection delegate method
connection:needNewBodyStream.Available in iOS 3.0 and later.
Declared in
NSURLError.h.NSURLErrorFileDoesNotExistReturned when a file does not exist.
Available in iOS 2.0 and later.
Declared in
NSURLError.h.NSURLErrorFileIsDirectoryReturned when a request for an FTP file results in the server responding that the file is not a plain file, but a directory.
Available in iOS 2.0 and later.
Declared in
NSURLError.h.NSURLErrorNoPermissionsToReadFileReturned when a resource cannot be read due to insufficient permissions.
Available in iOS 2.0 and later.
Declared in
NSURLError.h.NSURLErrorSecureConnectionFailedReturned when an attempt to establish a secure connection fails for reasons which cannot be expressed more specifically.
Available in iOS 2.0 and later.
Declared in
NSURLError.h.NSURLErrorServerCertificateHasBadDateReturned when a server certificate has a date which indicates it has expired, or is not yet valid.
Available in iOS 2.0 and later.
Declared in
NSURLError.h.NSURLErrorServerCertificateUntrustedReturned when a server certificate is signed by a root server which is not trusted.
Available in iOS 2.0 and later.
Declared in
NSURLError.h.NSURLErrorServerCertificateHasUnknownRootReturned when a server certificate is not signed by any root server.
Available in iOS 2.0 and later.
Declared in
NSURLError.h.NSURLErrorServerCertificateNotYetValidReturned when a server certificate is not yet valid.
Available in iOS 2.0 and later.
Declared in
NSURLError.h.NSURLErrorClientCertificateRejectedReturned when a server certificate is rejected.
Available in iOS 2.0 and later.
Declared in
NSURLError.h.NSURLErrorClientCertificateRequiredReturned when a client certificate is required to authenticate an SSL connection during an NSURLConnection request.
Available in iOS 4.0 and later.
Declared in
NSURLError.h.NSURLErrorCannotLoadFromNetworkReturned when a specific request to load an item only from the cache cannot be satisfied.
This error is sent at the point when the library would go to the network accept for the fact that is has been blocked from doing so by the “load only from cache” directive.
Available in iOS 2.0 and later.
Declared in
NSURLError.h.NSURLErrorCannotCreateFileReturned when
NSURLDownloadobject was unable to create the downloaded file on disk due to a I/O failure.Available in iOS 2.0 and later.
Declared in
NSURLError.h.NSURLErrorCannotOpenFileReturned when
NSURLDownloadwas unable to open the downloaded file on disk.Available in iOS 2.0 and later.
Declared in
NSURLError.h.NSURLErrorCannotCloseFileReturned when
NSURLDownloadwas unable to close the downloaded file on disk.Available in iOS 2.0 and later.
Declared in
NSURLError.h.NSURLErrorCannotWriteToFileReturned when
NSURLDownloadwas unable to write to the downloaded file on disk.Available in iOS 2.0 and later.
Declared in
NSURLError.h.NSURLErrorCannotRemoveFileReturned when
NSURLDownloadwas unable to remove a downloaded file from disk.Available in iOS 2.0 and later.
Declared in
NSURLError.h.NSURLErrorCannotMoveFileReturned when
NSURLDownloadwas unable to move a downloaded file on disk.Available in iOS 2.0 and later.
Declared in
NSURLError.h.NSURLErrorDownloadDecodingFailedMidStreamReturned when
NSURLDownloadfailed to decode an encoded file during the download.Available in iOS 2.0 and later.
Declared in
NSURLError.h.NSURLErrorDownloadDecodingFailedToCompleteReturned when
NSURLDownloadfailed to decode an encoded file after downloading.Available in iOS 2.0 and later.
Declared in
NSURLError.h.
Availability
- Available in OS X v10.2 with Safari 1.0 installed.
- Available in OS X v10.2.7 and later.
Declared In
NSURLError.hXPC Errors
Errors returned by XPC connections. Note that these are not currently available on iOS.
NSXPCConnectionInterrupted = 4097, NSXPCConnectionInvalid = 4099, NSXPCConnectionReplyInvalid = 4101, NSXPCConnectionErrorMinimum = 4096, NSXPCConnectionErrorMaximum = 4224
Constants
NSXPCConnectionInterruptedThe XPC connection was interrupted.
NSXPCConnectionInvalidThe XPC connection was invalid.
NSXPCConnectionReplyInvalidThe XPC connection replay was invalid.
NSXPCConnectionErrorMinimumThe XPC connection minimum error.
NSXPCConnectionErrorMaximumThe XPC connection maximum error.
Global Variables
Cocoa Error Domain
These constants defines the Cocoa error domain.
NSString *const NSCocoaErrorDomain; NSString *const NSFeatureUnsupportedError;
Constants
NSCocoaErrorDomainApplication Kit and Foundation Kit errors.
Available in iOS 2.0 and later.
Declared in
NSError.h.NSFeatureUnsupportedErrorNSFeatureUnsupportedErroris a new error code in theNSCocoaErrorDomainthat indicates a failure to perform the requested operation because the feature is not supported, either because the file system lacks the feature, or required libraries are missing, or other similar reasons.For example, some volumes may not support a Trash folder, so these methods will report failure by returning
NOorniland anNSErrorwithNSFeatureUnsupportedError.
Declared In
FoundationErrors.hNSURL Domain
This error domain is defined for NSURL.
extern NSString * const NSURLErrorDomain;
Constants
NSURLErrorDomainURL loading system errors
Available in iOS 2.0 and later.
Declared in
NSURLError.h.
Declared In
NSURLError.hNumeric Constants
NSDecimal Constants
Constants used by NSDecimal.
#define NSDecimalMaxSize (8) #define NSDecimalNoScale SHRT_MAX
Constants
NSDecimalMaxSizeThe maximum size of
NSDecimal.Gives a precision of at least 38 decimal digits, 128 binary positions.
Available in iOS 2.0 and later.
Declared in
NSDecimal.h.NSDecimalNoScaleSpecifies that the number of digits allowed after the decimal separator in a decimal number should not be limited.
Available in iOS 2.0 and later.
Declared in
NSDecimal.h.
Declared In
NSDecimal.hNSInteger and NSUInteger Maximum and Minimum Values
Constants representing the maximum and minimum values of NSInteger and NSUInteger.
#define NSIntegerMax LONG_MAX #define NSIntegerMin LONG_MIN #define NSUIntegerMax ULONG_MAX
Constants
NSIntegerMaxThe maximum value for an
NSInteger.Available in iOS 2.0 and later.
Declared in
NSObjCRuntime.h.NSIntegerMinThe minimum value for an
NSInteger.Available in iOS 2.0 and later.
Declared in
NSObjCRuntime.h.NSUIntegerMaxThe maximum value for an
NSUInteger.Available in iOS 2.0 and later.
Declared in
NSObjCRuntime.h.
Declared In
NSObjCRuntime.hExceptions
General Exception Names
Exceptions defined by NSException.
extern NSString *NSGenericException; extern NSString *NSRangeException; extern NSString *NSInvalidArgumentException; extern NSString *NSInternalInconsistencyException; extern NSString *NSMallocException; extern NSString *NSObjectInaccessibleException; extern NSString *NSObjectNotAvailableException; extern NSString *NSDestinationInvalidException; extern NSString *NSPortTimeoutException; extern NSString *NSInvalidSendPortException; extern NSString *NSInvalidReceivePortException; extern NSString *NSPortSendException; extern NSString *NSPortReceiveException; extern NSString *NSOldStyleException;
Constants
NSGenericExceptionA generic name for an exception.
You should typically use a more specific exception name.
Available in iOS 2.0 and later.
Declared in
NSException.h.NSRangeExceptionName of an exception that occurs when attempting to access outside the bounds of some data, such as beyond the end of a string.
Available in iOS 2.0 and later.
Declared in
NSException.h.NSInvalidArgumentExceptionName of an exception that occurs when you pass an invalid argument to a method, such as a
nilpointer where a non-nilobject is required.Available in iOS 2.0 and later.
Declared in
NSException.h.NSInternalInconsistencyExceptionName of an exception that occurs when an internal assertion fails and implies an unexpected condition within the called code.
Available in iOS 2.0 and later.
Declared in
NSException.h.NSMallocExceptionObsolete; not currently used.
Available in iOS 2.0 and later.
Declared in
NSException.h.NSObjectInaccessibleExceptionName of an exception that occurs when a remote object is accessed from a thread that should not access it.
See
NSConnection’senableMultipleThreads.Available in iOS 2.0 and later.
Declared in
NSException.h.NSObjectNotAvailableExceptionName of an exception that occurs when the remote side of the
NSConnectionrefused to send the message to the object because the object has never been vended.Available in iOS 2.0 and later.
Declared in
NSException.h.NSDestinationInvalidExceptionName of an exception that occurs when an internal assertion fails and implies an unexpected condition within the distributed objects.
This is a distributed objects–specific exception.
Available in iOS 2.0 and later.
Declared in
NSException.h.NSPortTimeoutExceptionName of an exception that occurs when a timeout set on a port expires during a send or receive operation.
This is a distributed objects–specific exception.
Available in iOS 2.0 and later.
Declared in
NSException.h.NSInvalidSendPortExceptionName of an exception that occurs when the send port of an
NSConnectionhas become invalid.This is a distributed objects–specific exception.
Available in iOS 2.0 and later.
Declared in
NSException.h.NSInvalidReceivePortExceptionName of an exception that occurs when the receive port of an
NSConnectionhas become invalid.This is a distributed objects–specific exception.
Available in iOS 2.0 and later.
Declared in
NSException.h.NSPortSendExceptionGeneric error occurred on send.
This is an
NSPort-specific exception.Available in iOS 2.0 and later.
Declared in
NSException.h.NSPortReceiveExceptionGeneric error occurred on receive.
This is an
NSPort-specific exception.Available in iOS 2.0 and later.
Declared in
NSException.h.NSOldStyleExceptionNo longer used.
Available in iOS 2.0 and later.
Declared in
NSException.h.
Declared In
NSException.hVersion Numbers
Foundation Version Number
Version of the Foundation framework in the current environment.
double NSFoundationVersionNumber;
Constants
NSFoundationVersionNumberThe version of the Foundation framework in the current environment.
Available in iOS 2.0 and later.
Declared in
NSObjCRuntime.h.
Declared In
NSObjCRuntime.hFoundation Framework Version Numbers
Constants to define Foundation Framework version numbers.
#define NSFoundationVersionNumber10_0 397.40 #define NSFoundationVersionNumber10_1 425.00 #define NSFoundationVersionNumber10_1_1 425.00 #define NSFoundationVersionNumber10_1_2 425.00 #define NSFoundationVersionNumber10_1_3 425.00 #define NSFoundationVersionNumber10_1_4 425.00 #define NSFoundationVersionNumber10_2 462.00 #define NSFoundationVersionNumber10_2_1 462.00 #define NSFoundationVersionNumber10_2_2 462.00 #define NSFoundationVersionNumber10_2_3 462.00 #define NSFoundationVersionNumber10_2_4 462.00 #define NSFoundationVersionNumber10_2_5 462.00 #define NSFoundationVersionNumber10_2_6 462.00 #define NSFoundationVersionNumber10_2_7 462.70 #define NSFoundationVersionNumber10_2_8 462.70 #define NSFoundationVersionNumber10_3 500.00 #define NSFoundationVersionNumber10_3_1 500.00 #define NSFoundationVersionNumber10_3_2 500.30 #define NSFoundationVersionNumber10_3_3 500.54 #define NSFoundationVersionNumber10_3_4 500.56 #define NSFoundationVersionNumber10_3_5 500.56 #define NSFoundationVersionNumber10_3_6 500.56 #define NSFoundationVersionNumber10_3_7 500.56 #define NSFoundationVersionNumber10_3_8 500.56 #define NSFoundationVersionNumber10_3_9 500.58 #define NSFoundationVersionNumber10_4 567.00 #define NSFoundationVersionNumber10_4_1 567.00 #define NSFoundationVersionNumber10_4_2 567.12 #define NSFoundationVersionNumber10_4_3 567.21 #define NSFoundationVersionNumber10_4_4_Intel 567.23 #define NSFoundationVersionNumber10_4_4_PowerPC 567.21 #define NSFoundationVersionNumber10_4_5 567.25 #define NSFoundationVersionNumber10_4_6 567.26 #define NSFoundationVersionNumber10_4_7 567.27 #define NSFoundationVersionNumber10_4_8 567.28 #define NSFoundationVersionNumber10_4_9 567.29 #define NSFoundationVersionNumber10_4_10 567.29 #define NSFoundationVersionNumber10_4_11 567.36 #define NSFoundationVersionNumber10_5 677.00 #define NSFoundationVersionNumber10_5_1 677.10 #define NSFoundationVersionNumber10_5_2 677.15 #define NSFoundationVersionNumber10_5_3 677.19 #define NSFoundationVersionNumber10_5_4 677.19 #define NSFoundationVersionNumber10_5_5 677.21 #define NSFoundationVersionNumber10_5_6 677.22 #define NSFoundationVersionNumber_iOS_2_0 678.24 #define NSFoundationVersionNumber_iOS_2_1 678.26 #define NSFoundationVersionNumber_iOS_2_2 678.29
Constants
NSFoundationVersionNumber10_0Foundation version released in OS X version 10.0.
Available in iOS 2.0 and later.
Declared in
NSObjCRuntime.h.NSFoundationVersionNumber10_1Foundation version released in OS X version 10.1.
Available in iOS 2.0 and later.
Declared in
NSObjCRuntime.h.NSFoundationVersionNumber10_1_1Foundation version released in OS X version 10.1.1.
Available in iOS 2.0 and later.
Declared in
NSObjCRuntime.h.NSFoundationVersionNumber10_1_2Foundation version released in OS X version 10.1.2.
Available in iOS 2.0 and later.
Declared in
NSObjCRuntime.h.NSFoundationVersionNumber10_1_3Foundation version released in OS X version 10.1.3.
Available in iOS 2.0 and later.
Declared in
NSObjCRuntime.h.NSFoundationVersionNumber10_1_4Foundation version released in OS X version 10.1.4.
Available in iOS 2.0 and later.
Declared in
NSObjCRuntime.h.NSFoundationVersionNumber10_2Foundation version released in OS X version 10.2.
Available in iOS 2.0 and later.
Declared in
NSObjCRuntime.h.NSFoundationVersionNumber10_2_1Foundation version released in OS X version 10.2.1.
Available in iOS 2.0 and later.
Declared in
NSObjCRuntime.h.NSFoundationVersionNumber10_2_2Foundation version released in OS X version 10.2.2.
Available in iOS 2.0 and later.
Declared in
NSObjCRuntime.h.NSFoundationVersionNumber10_2_3Foundation version released in OS X version 10.2.3.
Available in iOS 2.0 and later.
Declared in
NSObjCRuntime.h.NSFoundationVersionNumber10_2_4Foundation version released in OS X version 10.2.4.
Available in iOS 2.0 and later.
Declared in
NSObjCRuntime.h.NSFoundationVersionNumber10_2_5Foundation version released in OS X version 10.2.5.
Available in iOS 2.0 and later.
Declared in
NSObjCRuntime.h.NSFoundationVersionNumber10_2_6Foundation version released in OS X version 10.2.6.
Available in iOS 2.0 and later.
Declared in
NSObjCRuntime.h.NSFoundationVersionNumber10_2_7Foundation version released in OS X version 10.2.7.
Available in iOS 2.0 and later.
Declared in
NSObjCRuntime.h.NSFoundationVersionNumber10_2_8Foundation version released in OS X version 10.2.8.
Available in iOS 2.0 and later.
Declared in
NSObjCRuntime.h.NSFoundationVersionNumber10_3Foundation version released in OS X version 10.3.
Available in iOS 2.0 and later.
Declared in
NSObjCRuntime.h.NSFoundationVersionNumber10_3_1Foundation version released in OS X version 10.3.1.
Available in iOS 2.0 and later.
Declared in
NSObjCRuntime.h.NSFoundationVersionNumber10_3_2Foundation version released in OS X version 10.3.2.
Available in iOS 2.0 and later.
Declared in
NSObjCRuntime.h.NSFoundationVersionNumber10_3_3Foundation version released in OS X version 10.3.3.
Available in iOS 2.0 and later.
Declared in
NSObjCRuntime.h.NSFoundationVersionNumber10_3_4Foundation version released in OS X version 10.3.4.
Available in iOS 2.0 and later.
Declared in
NSObjCRuntime.h.NSFoundationVersionNumber10_3_5Foundation version released in OS X version 10.3.5.
Available in iOS 2.0 and later.
Declared in
NSObjCRuntime.h.NSFoundationVersionNumber10_3_6Foundation version released in OS X version 10.3.6.
Available in iOS 2.0 and later.
Declared in
NSObjCRuntime.h.NSFoundationVersionNumber10_3_7Foundation version released in OS X version 10.3.7.
Available in iOS 2.0 and later.
Declared in
NSObjCRuntime.h.NSFoundationVersionNumber10_3_8Foundation version released in OS X version 10.3.8.
Available in iOS 2.0 and later.
Declared in
NSObjCRuntime.h.NSFoundationVersionNumber10_3_9Foundation version released in OS X version 10.3.9.
Available in iOS 2.0 and later.
Declared in
NSObjCRuntime.h.NSFoundationVersionNumber10_4Foundation version released in OS X version 10.4.
Available in iOS 2.0 and later.
Declared in
NSObjCRuntime.h.NSFoundationVersionNumber10_4_1Foundation version released in OS X version 10.4.1.
Available in iOS 2.0 and later.
Declared in
NSObjCRuntime.h.NSFoundationVersionNumber10_4_2Foundation version released in OS X version 10.4.2.
Available in iOS 2.0 and later.
Declared in
NSObjCRuntime.h.NSFoundationVersionNumber10_4_3Foundation version released in OS X version 10.4.3.
Available in iOS 2.0 and later.
Declared in
NSObjCRuntime.h.NSFoundationVersionNumber10_4_4_IntelFoundation version released in OS X version 10.4.4 for Intel.
Available in iOS 2.0 and later.
Declared in
NSObjCRuntime.h.NSFoundationVersionNumber10_4_4_PowerPCFoundation version released in OS X version 10.4.4 for PowerPC.
Available in iOS 2.0 and later.
Declared in
NSObjCRuntime.h.NSFoundationVersionNumber10_4_5Foundation version released in OS X version 10.4.5.
Available in iOS 2.0 and later.
Declared in
NSObjCRuntime.h.NSFoundationVersionNumber10_4_6Foundation version released in OS X version 10.4.6.
Available in iOS 2.0 and later.
Declared in
NSObjCRuntime.h.NSFoundationVersionNumber10_4_7Foundation version released in OS X version 10.4.7.
Available in iOS 2.0 and later.
Declared in
NSObjCRuntime.h.NSFoundationVersionNumber10_4_8Foundation version released in OS X version 10.4.8.
Available in iOS 2.0 and later.
Declared in
NSObjCRuntime.h.NSFoundationVersionNumber10_4_9Foundation version released in OS X version 10.4.9.
Available in iOS 2.0 and later.
Declared in
NSObjCRuntime.h.NSFoundationVersionNumber10_4_10Foundation version released in OS X version 10.4.10.
Available in iOS 2.0 and later.
Declared in
NSObjCRuntime.h.NSFoundationVersionNumber10_4_11Foundation version released in OS X version 10.4.11.
Available in iOS 2.0 and later.
Declared in
NSObjCRuntime.h.NSFoundationVersionNumber10_5Foundation version released in OS X version 10.5.0.
Available in iOS 2.0 and later.
Declared in
NSObjCRuntime.h.NSFoundationVersionNumber10_5_1Foundation version released in OS X version 10.5.1.
Available in iOS 2.0 and later.
Declared in
NSObjCRuntime.h.NSFoundationVersionNumber10_5_2Foundation version released in OS X version 10.5.2.
Available in iOS 2.2 and later.
Declared in
NSObjCRuntime.h.NSFoundationVersionNumber10_5_3Foundation version released in OS X version 10.5.3.
Available in iOS 2.2 and later.
Declared in
NSObjCRuntime.h.NSFoundationVersionNumber10_5_4Foundation version released in OS X version 10.5.4.
Available in iOS 2.2 and later.
Declared in
NSObjCRuntime.h.NSFoundationVersionNumber10_5_5Foundation version released in OS X version 10.5.5.
Available in iOS 4.0 and later.
Declared in
NSObjCRuntime.h.NSFoundationVersionNumber10_5_6Foundation version released in OS X version 10.5.6.
Available in iOS 4.0 and later.
Declared in
NSObjCRuntime.h.NSFoundationVersionNumber_iOS_2_0Foundation version released in iOS version 2.0.
This constant is only available on iOS.
NSFoundationVersionNumber_iOS_2_1Foundation version released in iOS version 2.1.
This constant is only available on iOS.
NSFoundationVersionNumber_iOS_2_2Foundation version released in iOS version 2.2.
This constant is only available on iOS.
Declared In
NSObjCRuntime.h© 2012 Apple Inc. All Rights Reserved. (Last updated: 2012-09-19)