views:

61

answers:

1

Sorry for the multitude of iPhone Programming newb questions but..

what is the reason for having an unsigned type for something such as

- (unsigned)count

for the NSArray class.

Why not just define it as

- (int)count

?

+8  A: 

An array can't have a negative number of items, so an unsigned integer is a much better match for the kinds of values this method will actually return.

Alex