ここにはおそらく私の C 知識の穴がありますが、なぜこれが起こったのかについて少し混乱しています。
(lldb) p lineGroup
(NSInteger) $17 = -1
(lldb) p (lineGroup > 4)
(bool) $18 = true
(lldb) p (lineGroup < 0 )
(bool) $19 = false
(lldb) p (-1 < 0)
(bool) $20 = true
(lldb) p ((int)lineGroup < 0 )
(bool) $21 = false
(lldb) p ((int)lineGroup > 4)
(bool) $22 = true
(lldb)
変数は次のlineGroup
ように割り当てられます。
- (void)gotLineGroupInformation:(NSString *)lineGroupString
{
NSInteger lineGroup = [lineGroupString integerValue];
if(lineGroup >= 0)
{
// Always gets called
}
else
{
// Never gets called
}
}
ありがとう、アンディ