For example is it more efficient to use NSInteger or int when defining variables?
In Java, is it more efficient to use Integer or the int primitive data type?
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.
NSIntegeris not an object, it is simply a synonym that makes ints platform independent as you can see from the definition:NSNumber, however, is an object type. You would e.g. use it when you need to store numbers in anNSArray. If you are doing calculations or indexing,NSIntegerwill be easier to work with and also more efficient.