问题描述
我有一个PFQueryTableViewController
表,该表从解析数据库中获取信息.当用户选择一行时,它将转到另一个VC.在该VC用户中,删除Parse表中的一些数据.该分析表与我已加载PFQueryTableViewController
的表相同.因此,我不需要显示这些已删除的数据.
I have a PFQueryTableViewController
table, which is getting info from parse database. When user select a row it goes to another VC. In that VC user delete some data in Parse table. This Parse table is the same table I have loaded my PFQueryTableViewController
. Therefore, I do not need these deleted data to be shown.
当用户按下后退按钮时,PFQueryTableViewController
中的此方法将被调用:
When user press back button, this method in PFQueryTableViewController
get called:
-(void) viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
[self.tableView reloadData];
[super objectsWillLoad];
}
我已经逐行检查了.它正在重新加载数据,但没有调用:
I have checked line by line. It is reloading data but it is not calling:
- (PFQuery *)queryForTable {
PFQuery *query = [PFQuery queryWithClassName:@"MyClass"];
[query whereKey:@"user" equalTo:[PFUser currentUser]];
[query orderByDescending:@"createdAt"];
return query;
}
我删除了VC中的某些数据,并且在云上不存在.但是当我按下后退按钮时,它存在.但是,当我刷新表时,删除的数据将消失!
I deleted some data in the VC and dose not exist on the cloud. But when I press back button it exist. However, when I refresh the table, deleted data will be vanished!
我阅读了文档文档,但我找不到如何调用queryForTable
方法连接到云并再次读取数据的方法.
I read documentation documentation but I can't find how I can call queryForTable
method to connect to cloud and read data again.
推荐答案
您必须调用此
[self loadObjects];
代替
[self.tableView reloadData];
这篇关于如何调用queryForTable从PFQueryTableViewController中的Parse云中重新加载数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!