You need to use NSNumber , as others have said, or use NSString with a string representation of a number. It doesn't really matter what, but NSNumber will be more efficient.
You cannot just throw an int , let it be interpreted as a pointer, and then drop it on the output. The reason is that an object (which int will be interpreted as a pointer to) will receive a retain message when it is added to the array, and this will certainly fail because it will be an invalid pointer.
Jakob borg
source share