I'm working on an IOS project that uses NSInteger to count opening and closing. The times are read at 2200 is equivalent to 10pm. I would like to see if something is within an hour of closing, so I compare the real world time in integer (works) to the closing time - 100 but the math isn't working as expected.
Custom class:
@property (assign) NSInteger *sus;
@property (assign) NSInteger *sue;
In Controller:
custom_class *location = object
resultINT = real world time in Integer with 24 hr
NSLog(@"Result INT: %i", resultInt);
NSLog(@"location.sue: %i", location.sue);
NSLog(@"Location - 1hr %i", location.sue -100);
NSInteger *yellowEnd = location.sue - 100;
NSLog(@"Yellow %i", yellowEnd);
result:
2014-07-13 18:23:51.269 Time-Genesis-Marcus[7591:416078] Result INT: 1823
2014-07-13 18:23:51.269 Time-Genesis-Marcus[7591:416078] location.sue: 2200
2014-07-13 18:23:51.269 Time-Genesis-Marcus[7591:416078] Location - 1hr 1800
2014-07-13 18:23:51.270 Time-Genesis-Marcus[7591:416078] Yellow 1800
Why isn't the third and forth lines returned 2100? thanks