Furqi
Furqi

Reputation: 2403

What is difference between NSUInteger myID and int myID?

@interface MyObject : NSObject {
 NSUInteger myID;
}

@property (nonatomic) NSUInteger myID;

Upvotes: 1

Views: 227

Answers (2)

Jhaliya - Praveen Sharma
Jhaliya - Praveen Sharma

Reputation: 31730

NSUInteger is unsigned integer and int is signed integer

Upvotes: 1

Ishu
Ishu

Reputation: 12787

NSUInteger is an unsigned integer, and (can be/should be) used in cases where you are not expecting negative values i.e. the index of an array.

NSInteger is typedef for int , and it includes negative values.

Both having different limits

unsigned int is 0 to 4294967295 signed is -268435454 to 268435455 .

Upvotes: 6

Related Questions