修复了数组可能越界的问题
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
#import "ThemeColor.h"
|
||||
#import "TTPopup.h"
|
||||
#import "XPMacro.h"
|
||||
#import "NSArray+Safe.h"
|
||||
///Model
|
||||
#import "MonentsInteractiveModel.h"
|
||||
///P
|
||||
@@ -105,7 +106,7 @@
|
||||
|
||||
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
if (self.datasource.count > 0) {
|
||||
MonentsInteractiveModel * model = [self.datasource objectAtIndex:indexPath.row];
|
||||
MonentsInteractiveModel * model = [self.datasource safeObjectAtIndex1:indexPath.row];
|
||||
return model.worldName.length > 0? 130 : 90;
|
||||
}
|
||||
return KScreenHeight - kNavigationHeight;
|
||||
@@ -114,7 +115,7 @@
|
||||
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
if (self.datasource.count > 0) {
|
||||
XPMonentsInteractiveTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMonentsInteractiveTableViewCell class])];
|
||||
MonentsInteractiveModel * model = [self.datasource objectAtIndex:indexPath.row];
|
||||
MonentsInteractiveModel * model = [self.datasource safeObjectAtIndex1:indexPath.row];
|
||||
cell.interactiveInfo = model;
|
||||
return cell;
|
||||
}
|
||||
@@ -126,7 +127,7 @@
|
||||
[tableView deselectRowAtIndexPath:indexPath animated:YES];
|
||||
if (self.datasource.count > 0) {
|
||||
XPMonentsDetailViewController * detailVC = [[XPMonentsDetailViewController alloc] init];
|
||||
MonentsInteractiveModel * model = [self.datasource objectAtIndex:indexPath.row];
|
||||
MonentsInteractiveModel * model = [self.datasource safeObjectAtIndex1:indexPath.row];
|
||||
MonentsInfoModel * monents = [[MonentsInfoModel alloc] init];
|
||||
monents.dynamicId = model.dynamicId;
|
||||
detailVC.monentsInfo = monents;
|
||||
|
Reference in New Issue
Block a user