Updated answer:
You can make use of the z
and t
modifiers to handle NSInteger
and NSUInteger
without warnings, on all architectures.
You want to use %zd
for signed, %tu
for unsigned, and %tx
for hex.
This information comes courtesy of Greg Parker.
Original answer:
The official recommended approach is to use %ld
as your specifier, and to cast the actual argument to a long
.