ios - 拉动刷新不会分离(不会停止刷新)-Objective-C

标签 ios objective-c github pull-to-refresh

我面临的问题是,我的 tableView 在我将其拉下(刷新)后不会停止刷新。我正在使用 github 上的 Yalantis“Pull to Refresh”存储库(可在此处找到: https://github.com/Yalantis/Pull-to-Refresh.Rentals-iOS )并尝试将其实现到我现有的项目中。

我已经实现了头文件,添加了属性,但在说明中它具有未刷新(如果您愿意)是链接到按钮的 IBAction。显然不是我想要的。这是我正在使用的代码


请记住,我已经取出了很多内容,只保留了相关的内容。任何帮助都会很棒。谢谢。

- (void)viewDidLoad {
[super viewDidLoad];

[self setupRefreshControl];

}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}

- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];

[self.sunnyRefreshControl startRefreshing];
PFQuery *query (i perform query for table)
}


# pragma mark - YALSunyRefreshControl methods

-(void)setupRefreshControl{

self.sunnyRefreshControl = [YALSunnyRefreshControl attachToScrollView:self.tableView
                                                               target:self
                                                        refreshAction:@selector(sunnyControlDidStartAnimation)];
}

 -(void)sunnyControlDidStartAnimation{

// start loading something
[self.tableView reloadData];

}



-(IBAction)endAnimationHandle{

[self.sunnyRefreshControl endRefreshing];
}

最佳答案

实际上您可以随时调用该方法

[self.sunnyRefreshControl endRefreshing];

按钮处理程序只是示例 ^_^

(IBAction)endAnimationHandle{  [self.sunnyRefreshControl endRefreshing];  }

如果您仍有疑问,可以在 github repo 上创建问题。谢谢您

关于ios - 拉动刷新不会分离(不会停止刷新)-Objective-C,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29664631/

相关文章:

ios - 如何在 iOS 7 下更改 UIPickerView 中文本的颜色?

github - 将拉取请求标记为准备好审查

linux - 当我编译时,我通过了配置但是当我是 'making'时遇到错误

iOS 洪水填充 : UIImage vs Core Graphics

ios - View 的 hidden = yes 和 alpha = 0.0f 有什么区别

javascript - 如何防止 html5 视频播放器播放图标在 iPhone Safari 中消失

ios - 使用核心数据更新对象会插入一条新记录

objective-c - 使 NSButton 处于非事件状态

ios - 将 protected Objective-C 实例变量公开给子类

git - 我怎样才能将一些文件忽略到与 github 同步的本地存储库中?