Ahsan Ahsan - 1 year ago 225
Objective-C Question

How to compare two NSInteger?

How do we compare two NSInteger numbers ? I have two NSIntegers and comparing them the regular way wasnt working.

if (NSIntegerNumber1 >= NSIntegerNumber2) {
//do something

Eventhough, the first value was 13 and the second value was 17, the if loop is executing

Any idea ?

Answer Source
NSInteger int1;
NSInteger int2;

int1 = 13;
int2 = 17;

if (int1 > int2)
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download