-(NSUInteger)indexOfObject:(ObjectType)anObject;
点击这里官方文档
Return Value
The lowest
index whose corresponding array value is equal to anObject.
If none of the objects in the array is equal to anObject, returns NSNotFound
.
[[NetworkTool managerTool] requesNoHud:POST UrlString:[HttpInterface getJinTiKuProfession] parameters:mdict finished:^(id result, NSError *error) {
if (result) {
if ([[result objectForKey:@"success"]boolValue]) {
NSDictionary * info = [result objectForKey:@"entity"][@"info"];
self.infoModel = [WJSubjectCategoryModel mj_objectArrayWithKeyValuesArray:info];
[self.leftTableView reloadData];
[self.rightTableView reloadData];
NSMutableArray * mArray = [[NSMutableArray alloc]init];
// 遍历self.infoModel数组,把status的值拿出来,存入数组
for (WJSubjectCategoryModel * model in self.infoModel) {
[mArray addObject:model.status];
}
// The lowest index whose corresponding array value is equal to anObject. If none of the objects in the array is equal to anObject, returns NSNotFound.
// 对应数组值等于一个对象的最低索引
NSUInteger index = [mArray indexOfObject:@"0"];
// if (index == NSNotFound) {
// index = 0;
// }
[self.leftTableView selectRowAtIndexPath:[NSIndexPath indexPathForRow:index inSection:0]
animated:YES
scrollPosition:UITableViewScrollPositionNone];
}else{
[MBProgressHUD showError:[result objectForKey:@"message"]];
}
}else{
[MBProgressHUD showError:@"格式错误"];
}
}];
网友评论