Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/120.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios UITableViewDataSource方法返回类型NSInteger而不是NSInteger_Ios_Objective C_Cocoa Touch_Cocoa_Delegates - Fatal编程技术网

Ios UITableViewDataSource方法返回类型NSInteger而不是NSInteger

Ios UITableViewDataSource方法返回类型NSInteger而不是NSInteger,ios,objective-c,cocoa-touch,cocoa,delegates,Ios,Objective C,Cocoa Touch,Cocoa,Delegates,为什么这些方法会返回NSInteger而不是整数?实际上,我没有什么意义。我相信这是因为有时它会返回负数,如-1,以指示错误。但是,您可能永远不会看到这一点,因为类可能会处理翻译 我假设你知道一个整数是一个无符号整数,不能是负数 因为上述三种方法的最小值均为0。表示最后一个对象始终为零。 所以,这里有一个NSInteger。在该方法中不可能使用以下值。可能重复: - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView -

为什么这些方法会返回NSInteger而不是整数?实际上,我没有什么意义。

我相信这是因为有时它会返回负数,如-1,以指示错误。但是,您可能永远不会看到这一点,因为类可能会处理翻译


我假设你知道一个整数是一个无符号整数,不能是负数

因为上述三种方法的最小值均为0。表示最后一个对象始终为零。 所以,这里有一个NSInteger。在该方法中不可能使用以下值。

可能重复:
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
- (NSInteger)tableView:(UITableView *)tableView sectionForSectionIndexTitle:(NSString *)title atIndex:(NSInteger)index