What’s the basic difference between the two..? it would be nice if can someone explain using the example of NSInteger and NSNumber.. Thanks
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The main difference is related to where they stay in the memory, objects are stored in the heap while value type are stored directly in the Stack …
heap : is an area of memory used for dynamic memory allocation.
stack : is the section of memory that is allocated for automatic variables within functions. Data is stored in stack using the Last In First Out (LIFO) method.
About NSInteger and NSNumber :
NSInteger is nothing more than a synonym for a long integer, while NSNumber is an Objective-C class, a subclass of NSValue to be specific.