![iphone – NSTimer崩溃,当我调用[Timer isValid]或[Timer invalidate],第1张 iphone – NSTimer崩溃,当我调用[Timer isValid]或[Timer invalidate],第1张](/aiimages/iphone+%E2%80%93+NSTimer%E5%B4%A9%E6%BA%83%2C%E5%BD%93%E6%88%91%E8%B0%83%E7%94%A8%5BTimer+isValid%5D%E6%88%96%5BTimer+invalidate%5D.png)
DecreaseTimer工作正常,但是当我调用[timerCountSeconds isValID]或[timerCountSeconds invalIDate]时,TimerCountSeconds崩溃.它们是这样使用的:
-(ID)initialize { //Gets called,when the app launches and when a UIbutton is pressed if ([timerCountSeconds isValID]) { [timerCountSeconds invalIDate]; } }- (voID)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { //Gets called,when you begin touching the screen //.... if ([decreaseTimer isValID]) { [decreaseTimer invalIDate]; } timerCountSeconds = [NSTimer scheduledTimerWithTimeInterval:0.1 target:self selector:@selector(runTimer) userInfo:nil repeats:YES]; //....}- (voID)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {//Gets called,when you stop touching the screen(not if you press the UIbutton for -(ID)initialize) //... decreaseTimer = [NSTimer scheduledTimerWithTimeInterval:0.05 target:self selector:@selector(decrease) userInfo:nil repeats:YES]; //...}-(voID)comept3 { //Gets calles when you rubbed the screen a bit if ([timerCountSeconds isValID]) { [timerCountSeconds invalIDate]; }} 我做错了什么?
你能帮我么?
以上是内存溢出为你收集整理的iphone – NSTimer崩溃,当我调用[Timer isValid]或[Timer invalidate]全部内容,希望文章能够帮你解决iphone – NSTimer崩溃,当我调用[Timer isValid]或[Timer invalidate]所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)