DIFFERENCE BETWEEN NSINTEGER AND NSUINTEGER

sandy taylor

Total Post:46

Points:324
Posted by  sandy taylor
 795  View(s)
Ratings:
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?

  1. Tarun Kumar

    Post:214

    Points:1642
    Re: Difference between NSInteger and NSUInteger

    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;
    NSLog(@"%d",nsinteger<nsuinteger);

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!