jos*_*osh 7 objective-c uitableview ios
调用[tableView reloadData]表视图的方法后,我的应用程序崩溃了.这是在删除单行tableview(具有表视图默认删除行为)和调用之后发生的[tableView reloadData],然后在此委托numberOfSectionsInTableView应用程序崩溃并向我显示崩溃消息后[UITableViewCell _setDeleteAnimationInProgress : ] : message sent to deallocated instance,我用Google搜索但无法获得健康的响应.如果任何人面临这种崩溃,那么请帮助找出这个问题.以下是我的代码.
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
return 2;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
if(section==0)
return [[dbSingleton sharedInstance] get_players_count];
else if(section==1)
return 0;
}
- (NSString )tableView:(UITableView )tableView titleForHeaderInSection:(NSInteger)section{
if(section==0)
return @"Player Detail";
return nil;
}
- (UITableViewCellEditingStyle)tableView:(UITableView )tableView editingStyleForRowAtIndexPath:(NSIndexPath )indexPath{
if(indexPath.section==1)
return UITableViewCellEditingStyleNone;
else
return UITableViewCellEditingStyleDelete;
}
}
-(CGFloat)tableView:(UITableView )tableView heightForRowAtIndexPath:(NSIndexPath )indexPath{
return 44;
}
Run Code Online (Sandbox Code Playgroud)
寻找回应.提前致谢.
| 归档时间: |
|
| 查看次数: |
3077 次 |
| 最近记录: |