Home > DeveloperSection > Forums > Difference between NSInteger and NSUInteger
sandy taylor
sandy taylor

Total Post:46

Posted on    December-01-2015 4:12 AM

 iPhone iPhone  Ios  Objective C 

 1 Reply(s)
 779  View(s)
Rate this:

Can any one tell me the difference between NSInteger and NSUInteger in Objective-C?

Which is better to use in an application and why it is better?

Tarun Kumar

Total Post:214

Posted on    December-02-2015 10:23 PM

You always be aware of integer conversion rules dealing with NSInteger and NSUInteger.
For example: NSInteger can takes and returns negative values, and NSUInteger takes values and returns only unsigned values.

NSInteger nsinteger = -1;
NSUInteger nsuinteger = 1;

Don't want to miss updates? Please click the below button!

Follow MindStick