Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 09-04-2008, 02:28 PM   #1 (permalink)
Registered Member
 
Join Date: Jul 2008
Location: Minneapolis, MN
Posts: 208
Scuba is on a distinguished road
Default Timer not fired while scrolling

I have a NSTimer on an interval, and on of the subviews of the controller that contains it is a Table View Controller. When the table is being scrolled the Timer pauses, and resumes after scrolling is complete. It is not a performance issue, it doesn't slow the firing, it completely stops it.

Is this a known issue? Is there a way to prevent this?
Scuba is offline   Reply With Quote
Old 09-04-2008, 05:50 PM   #2 (permalink)
New Member
 
Join Date: May 2008
Location: San Diego, CA
Posts: 79
cpatch is an unknown quantity at this point
Default

Do you have the timer on its own thread?
cpatch is offline   Reply With Quote
Old 09-05-2008, 05:12 AM   #3 (permalink)
I am evil trapper
 
Join Date: Jul 2008
Location: London
Posts: 299
trapper is on a distinguished road
Default

The timer never fires at all, or you mean it skips a few fires while you are scrolling?

Does a non-repeating timer still fire after the scrolling stops or does it just never fire at all?
trapper is offline   Reply With Quote
Old 09-08-2008, 03:56 PM   #4 (permalink)
Registered Member
 
Join Date: Jul 2008
Location: Minneapolis, MN
Posts: 208
Scuba is on a distinguished road
Default

Quote:
Originally Posted by trapper View Post
The timer never fires at all, or you mean it skips a few fires while you are scrolling?

Does a non-repeating timer still fire after the scrolling stops or does it just never fire at all?
The timer starts firing every .10 seconds as it should after is schedule it with repeats, then while the UITableView is being scrolled it pauses completely. After the scrolling is stopped the timer resumes normally.

Could be a threading issue, how can I put it on its own thread?
Scuba is offline   Reply With Quote
Old 09-08-2008, 04:09 PM   #5 (permalink)
New Member
 
Join Date: Sep 2008
Posts: 1,431
PhoneyDeveloper is on a distinguished road
Default

Cocoabuilder - Re: NSTimer and NSTableView

Also look at the docs for NSRunLoop:addTimer:forMode and especially NSEventTrackingRunLoopMode/UITrackingRunLoopMode.
PhoneyDeveloper is offline   Reply With Quote
Old 01-27-2009, 09:05 AM   #6 (permalink)
New Member
 
Join Date: Jan 2009
Posts: 4
spamer is on a distinguished road
Default How to solve this problem on iPhone/iPod Touch?

This is solution only valid for MAC, but it cannot be used on iPhone because there is no support for other forMode-s (e.g. NSModalPanelRunLoopMode or NSEventTrackingRunLoopMode).

Only the default is supported here.

Please give a hint.
spamer is offline   Reply With Quote
Old 01-27-2009, 09:34 AM   #7 (permalink)
Registered Member
 
ConAim's Avatar
 
Join Date: Jul 2008
Location: U.S
Posts: 51
ConAim is an unknown quantity at this point
Default

I'm thinking about implement this to my app as well, but kinda lazy. The solution is hook into willDisplayCell: event. Obviously this event will be called everything user scrolling. So just set an NSTimerInterval to indicate last time seen user scrolled. On the Timer itself, check if current time - last seen scrolled > whatever => indicated idle, so fire me. Clear? I don't even know yet. You try it first and let me know if this work....
ConAim is offline   Reply With Quote
Old 01-27-2009, 10:00 AM   #8 (permalink)
New Member
 
Join Date: Sep 2008
Posts: 1,431
PhoneyDeveloper is on a distinguished road
Default

Add the timer forMode NSRunLoopCommonModes.
PhoneyDeveloper is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 341
14 members and 327 guests
akacaj, alexP, ClerurcifeDer, Duncan C, givensur, glenn_sayers, GraffitiCircus, guusleijsten, JmayLive, NetGuru, Paul Slocum, Punkjumper, Sloshmonster, yys
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,649
Threads: 94,114
Posts: 402,883
Top Poster: BrianSlick (7,990)
Welcome to our newest member, Anwerbl
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 09:45 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0