| Framework | Foundation/Foundation.h |
| Declared in | NSByteOrder.h NSDate.h NSDecimal.h NSException.h NSObjCRuntime.h NSPathUtilities.h NSPort.h NSRange.h NSString.h NSZone.h |
This document describes the data types and constants found in the Foundation framework.
These constants specify an endian format.
enum _NSByteOrder {
NS_UnknownByteOrder = CFByteOrderUnknown,
NS_LittleEndian = CFByteOrderLittleEndian,
NS_BigEndian = CFByteOrderBigEndian
};
NS_UnknownByteOrderThe byte order is unknown.
Available in iPhone OS 2.0 and later.
Declared in NSByteOrder.h.
NS_LittleEndianThe byte order is little endian.
Available in iPhone OS 2.0 and later.
Declared in NSByteOrder.h.
NS_BigEndianThe byte order is big endian.
Available in iPhone OS 2.0 and later.
Declared in NSByteOrder.h.
These constants are returned by NSHostByteOrder.
Defines the signature for a Block used for comparison operations.
typedef NSComparisonResult (^NSComparator)(id obj1, id obj2);
You use NSComparator Blocks in comparison operations such as NSArray’s indexOfObject:inSortedRange:options:usingComparator:.
These constants are used to indicate how items in a request are ordered.
enum {
NSOrderedAscending = -1,
NSOrderedSame,
NSOrderedDescending
};
typedef NSInteger NSComparisonResult;
NSOrderedAscendingThe left operand is smaller than the right operand.
Available in iPhone OS 2.0 and later.
Declared in NSObjCRuntime.h.
NSOrderedSameThe two operands are equal.
Available in iPhone OS 2.0 and later.
Declared in NSObjCRuntime.h.
NSOrderedDescendingThe left operand is greater than the right operand.
Available in iPhone OS 2.0 and later.
Declared in NSObjCRuntime.h.
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).
NSObjCRuntime.h
Used to describe a decimal number.
typedef struct {
signed int _exponent:8;
unsigned int _length:4;
unsigned int _isNegative:1;
unsigned int _isCompact:1;
unsigned int _reserved:18;
unsigned short _mantissa[NSDecimalMaxSize];
} NSDecimal;
The fields of NSDecimal are private.
Used by the functions described in "Decimals".
NSDecimal.h
Specifies a bitfield used to configure the behavior of elements in an instance of NSHashTable.
typedef NSUInteger NSHashTableOptions
NSHashTable.hUsed to describe an integer.
#if __LP64__ || TARGET_OS_EMBEDDED || TARGET_OS_IPHONE || TARGET_OS_WIN32 || NS_BUILD_32_LIKE_64 typedef long NSInteger; #else typedef int NSInteger; #endif
When building 32-bit applications, NSInteger is a 32-bit integer. A 64-bit application treats NSInteger as a 64-bit integer.
NSObjCRuntime.h
Specifies a bitfield used to configure the behavior of elements in an instance of NSMapTable.
typedef NSUInteger NSMapTableOptions
NSMapTable.h
A structure used to describe a portion of a series—such as characters in a string or objects in an NSArray object.
typedef struct _NSRange {
NSUInteger location;
NSUInteger length;
} NSRange;
locationThe start index (0 is the first, as in C arrays).
lengthThe number of items in the range (can be 0).
Foundation functions that operate on ranges include the following:
NSRange.h
Type indicating a parameter is a pointer to an NSRange structure.
typedef NSRange *NSRangePointer;
NSRange.h
These constants specify the location of a variety of directories.
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,
NSItemReplacementDirectory = 99,
NSAllApplicationsDirectory = 100,
NSAllLibrariesDirectory = 101
};
typedef NSUInteger NSSearchPathDirectory;
NSApplicationDirectorySupported applications (/Applications).
Available in iPhone OS 2.0 and later.
Declared in NSPathUtilities.h.
NSDemoApplicationDirectoryUnsupported applications and demonstration versions.
Available in iPhone OS 2.0 and later.
Declared in NSPathUtilities.h.
NSDeveloperApplicationDirectoryDeveloper applications (/Developer/Applications).
Available in iPhone OS 2.0 and later.
Declared in NSPathUtilities.h.
NSAdminApplicationDirectorySystem and network administration applications.
Available in iPhone OS 2.0 and later.
Declared in NSPathUtilities.h.
NSLibraryDirectoryVarious user-visible documentation, support, and configuration files (/Library).
Available in iPhone OS 2.0 and later.
Declared in NSPathUtilities.h.
NSDeveloperDirectoryDeveloper resources (/Developer).
Deprecated: Beginning with Xcode 3.0, developer tools can be installed in any location.
Available in iPhone OS 2.0 and later.
Declared in NSPathUtilities.h.
NSUserDirectoryUser home directories (/Users).
Available in iPhone OS 2.0 and later.
Declared in NSPathUtilities.h.
NSDocumentationDirectoryDocumentation.
Available in iPhone OS 2.0 and later.
Declared in NSPathUtilities.h.
NSDocumentDirectoryDocument directory.
Available in iPhone OS 2.0 and later.
Declared in NSPathUtilities.h.
NSCoreServiceDirectoryLocation of core services (System/Library/CoreServices).
Available in iPhone OS 2.0 and later.
Declared in NSPathUtilities.h.
NSDesktopDirectoryLocation of user’s desktop directory.
Available in iPhone OS 2.0 and later.
Declared in NSPathUtilities.h.
NSCachesDirectoryLocation of discardable cache files (Library/Caches).
Available in iPhone OS 2.0 and later.
Declared in NSPathUtilities.h.
NSApplicationSupportDirectoryLocation of application support files (Library/Application Support).
Available in iPhone OS 2.0 and later.
Declared in NSPathUtilities.h.
NSDownloadsDirectoryLocation of the user’s downloads directory.
The NSDownloadsDirectory flag will only produce a path only when the NSUserDomainMask is provided.
Available in iPhone OS 2.0 and later.
Declared in NSPathUtilities.h.
NSAllApplicationsDirectoryAll directories where applications can occur.
Available in iPhone OS 2.0 and later.
Declared in NSPathUtilities.h.
NSAllLibrariesDirectoryAll directories where resources can occur.
Available in iPhone OS 2.0 and later.
Declared in NSPathUtilities.h.
NSPathUtilities.h
Search path domain constants specifying base locations for the NSSearchPathDirectory type.
enum {
NSUserDomainMask = 1,
NSLocalDomainMask = 2,
NSNetworkDomainMask = 4,
NSSystemDomainMask = 8,
NSAllDomainsMask = 0x0ffff,
};
typedef NSUInteger NSSearchPathDomainMask;
NSUserDomainMaskThe user’s home directory—the place to install user’s personal items (~).
Available in iPhone OS 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 iPhone OS 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 iPhone OS 2.0 and later.
Declared in NSPathUtilities.h.
NSSystemDomainMaskProvided by Apple — can’t be modified (/System) .
Available in iPhone OS 2.0 and later.
Declared in NSPathUtilities.h.
NSAllDomainsMaskAll domains.
Includes all of the above and future items.
Available in iPhone OS 2.0 and later.
Declared in NSPathUtilities.h.
NSPathUtilities.h
Type for the platform-specific native socket handle.
typedef int NSSocketNativeHandle;
NSPort.h
Type representing string-encoding values.
typedef NSUInteger NSStringEncoding;
See String Encodings for a list of values.
NSString.h
Opaque structure containing endian-independent double value.
typedef struct {
unsigned long long v;
} NSSwappedDouble;
The fields of an NSSwappedDouble are private.
NSByteOrder.h
Opaque type containing an endian-independent float value.
typedef struct {
unsigned long v;
} NSSwappedFloat;
The fields of an NSSwappedFloat are private.
NSByteOrder.hUsed to specify a time interval, in seconds.
typedef double NSTimeInterval;
NSTimeInterval is always specified in seconds; it yields sub-millisecond precision over a range of 10,000 years.
NSDate.h
Used for the function handling exceptions outside of an exception-handling domain.
typedef volatile void NSUncaughtExceptionHandler(NSException *exception);
You can set exception handlers using NSSetUncaughtExceptionHandler.
NSException.hUsed to describe an unsigned integer.
#if __LP64__ || TARGET_OS_EMBEDDED || TARGET_OS_IPHONE || TARGET_OS_WIN32 || NS_BUILD_32_LIKE_64 typedef unsigned long NSUInteger; #else typedef unsigned int NSUInteger; #endif
When building 32-bit applications, NSUInteger is a 32-bit unsigned integer. A 64-bit application treats NSUInteger as a 64-bit unsigned integer
NSObjCRuntime.h
Used to identify and manage memory zones.
typedef struct _NSZone NSZone;
NSZone.h
Last updated: 2009-08-20