Consistently use NSInteger typedefs

NSInteger != int on all platforms; native types (e.g. NSInteger) should
generally be preferred for platform agnostic code.