gpt4 book ai didi

uitableview - 使用EGOTableViewPullRefresh更新表

转载 作者:行者123 更新时间:2023-12-03 18:18:08 25 4
gpt4 key购买 nike

我正在使用plist文件填充表格单元格,现在我添加了EGOTableViewPullRefresh API来更新单元格,但是我不知道如何将我的plist url文件与此API相匹配

//this is my plist code that load from server 
NSURL *url = [NSURL URLWithString:@"http://example.com/news.plist"];
titles = [[NSArray arrayWithContentsOfURL:url] retain];

编辑:
#pragma mark -
#pragma mark Data Source Loading / Reloading Methods

- (void)reloadTableViewDataSource{

// should be calling your tableviews data source model to reload
// put here just for demo
_reloading = YES;
[self.tableView reloadData];

}

- (void)doneLoadingTableViewData{

// model should call this when its done loading
_reloading = NO;
[_refreshHeaderView egoRefreshScrollViewDataSourceDidFinishedLoading:self.tableView];

}


#pragma mark -
#pragma mark UIScrollViewDelegate Methods

- (void)scrollViewDidScroll:(UIScrollView *)scrollView{

[_refreshHeaderView egoRefreshScrollViewDidScroll:scrollView];

}

- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate{

[_refreshHeaderView egoRefreshScrollViewDidEndDragging:scrollView];

}


#pragma mark -
#pragma mark EGORefreshTableHeaderDelegate Methods

- (void)egoRefreshTableHeaderDidTriggerRefresh:(EGORefreshTableHeaderView*)view{

[self reloadTableViewDataSource];
[self performSelector:@selector(doneLoadingTableViewData) withObject:nil afterDelay:3.0];

}

- (BOOL)egoRefreshTableHeaderDataSourceIsLoading:(EGORefreshTableHeaderView*)view{

return _reloading; // should return if data source model is reloading

}

- (NSDate*)egoRefreshTableHeaderDataSourceLastUpdated:(EGORefreshTableHeaderView*)view{

return [NSDate date]; // should return date data source was last changed

}

最佳答案

您应该只能够调用reloadData,这将刷新dataSource。对于“拉动刷新”功能,此逻辑也应该相同。

关于uitableview - 使用EGOTableViewPullRefresh更新表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6355918/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com