Return to the Alphabetic Index
Return to the Class Browser
Return to the Picture Browser
Copyright (c) 1994 by NeXT Computer, Inc. All Rights Reserved.

NSNumber

Inherits From: NSValue : NSObject

Conforms To: NSCoding, NSCopying (NSValue) NSObject (NSObject)

Declared In: Foundation/NSValue.h

Class Description

NSNumber objects provide an object-oriented wrapper for the standard C-language number data types (int, double, etc.). The Foundation Kit's collection classes can store only objects, so this class provides a way to prepare numbers of various types for use with the collection classes.

NSNumber, which inherits from NSValue, provides methods for creating number objects that contain data of a specified type. It also provides methods for extracting data from a number object and casting the data to be of a particular type. For determining whether two number objects are equal, NSNumber provides the compare: method.

Allocating and Initializing

Accessing Data

Comparing Data