开发者

What's the purpose of unsigned type here?

Sorry for the multitude of开发者_JAVA百科 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

?


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜