An NSValue object is a simple container for a single C or Objective-C data item. It can hold any of the scalar types such as int, float, and char, as well as pointers, structures, and object ids. The purpose of this class is to allow items of such data types to be added to collections such as instances of NSArray and NSSet, which require their elements to be objects. NSValue objects are always immutable.
int theInt = 123;
const void *myVal = &theInt;
valObj = [NSValue value:myVal withObjCType:@encode(int*)];