开发者

Inconsistent type for section in UITableViews

开发者 https://www.devze.com 2023-01-29 13:13 出处:网络
In some places, sections are referred to as NSIntegers - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section

In some places, sections are referred to as NSIntegers

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section

But in NSIndexPath, they are clearly defined as NSUIntegers.

section
An index number identifying a section in a table view. (read-only)

@property(readonly) NSUInteger section

Aside from the obvious overflow implications (would have to be a really big table), this creates a lot of annoyance for me since I turn on the Sign Comparison compiler warning option.

Anyone aw开发者_如何转开发are of a valid reason for this, or is it just a bug?


At this point, I'm assuming this is just bad design and dealing with it. Oh well.

0

精彩评论

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