如果声明:我发现了一些奇怪的东西。为什么我的第二个“如果”等于否?
int a = bookSettings.tracks.count;
int b = _currentChapter - 1;
NSLog(@"a: %d", a);
NSLog(@"b: %d", b);
if (a > b)
NSLog(@"yes 1");
else NSLog(@"no 1");
if (bookSettings.tracks.count > (_currentChapter -1))
NSLog(@"yes 2");
else NSLog(@"no 2");
并记录
a: 27
b: -1
yes 1
no 2