使用非常快速的滑动时出现问题 [英] problem when swipe using very fast

查看:95
本文介绍了使用非常快速的滑动时出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个pdf阅读器,我必须在手指滑动上加载pdf书的每一页。对于每次滑动,我正在递增一个页面,如果我正在慢慢地滑动它工作正常。如果滑动如此之快它就会崩溃,它根本不起作用。

I am developing an pdf reader in which i have to load each page of the pdf book on finger swipe. For each swipe i am incrementing one page it is working fine if i am swiping slowly.where it is not at all working if the swipe is so fast it gets crashed.

大家好我用NSobject类引用解决了上面的问题它只有两行...

hi folks i resolved the above issue with the NSobject class reference it has only two lines..

[NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(loadPagesAccordingToCurrentOrientation) object:nil];
[self performSelector:@selector(loadPagesAccordingToCurrentOrientation) withObject:nil afterDelay:0.5];


推荐答案

一些代码用于我的问题

[NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(loadPagesAccordingToCurrentOrientation)object:nil];

[NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(loadPagesAccordingToCurrentOrientation) object:nil];

[self performSelector:@选择器(loadPagesAccordingToCurrentOrientation)withObject:nil afterDelay:0.5];

[self performSelector:@selector(loadPagesAccordingToCurrentOrientation) withObject:nil afterDelay:0.5];

这篇关于使用非常快速的滑动时出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆