UIScrollView blocks run loop?
I implemented a NSTimer(repeats) and UITableView on the same viewController.
Somehow, when I scroll through the tableView, the run loop seems to stop firing the NSTimer.
The same goes for UITextView, which is also a subclass of UIScrollView.
May I know what is happening here?
- Cocoa singleton and shared instances
- SFSafariViewController: Hide navigation bar
- Xcode preprocessor macro to check if Base SDK >= iOS 7.0
- How to programmatically set iOS device time?
- Setup that allows a child NSManagedObjectContext to Fetch when it's parent context is Saving
- Is there a way to toggle wifi on and off programatically in iOS?
Solutions Collect From Internet About “UIScrollView blocks run loop?”
The reason that the timer stops firing is that the run loop switches to
UITrackingRunLoopMode during scrolling and the timer is not added by default to that mode. You can do that manually when you start the timer:
NSTimer *timer = [NSTimer timerWithTimeInterval:1.0 target:self selector:@selector(timerFired:) userInfo:nil repeats:YES]; NSRunLoop *runloop = [NSRunLoop currentRunLoop]; [runloop addTimer:timer forMode:NSRunLoopCommonModes]; [runloop addTimer:timer forMode:UITrackingRunLoopMode];
- How to “set a breakpoint in malloc_error_break to debug”
- Type CCC doesnt conform to protocol 'NSObjectProtocol'
- App crashes after updating CoreData model that is being displayed in a UITableView
- How To Check If An Email Address Is Already In Use Firebase
- _OBJC_CLASS_$_SBJsonParser referenced from: error
- How to create a layout like Featured page in App Store?
- Firebase dynamic link not opening the app iOS
- How do you show Xcode's build log? (Trying to verify if iPhone distribution build zip was created correctly.)
- Finding Private API Call _terminateWithStatus
- Springboard failed to launch application with error 3, 0, 4, etc
- Accidentally removed xcassets file from XCode project
- UIImagePickerController custom FlashMode button is not working on IOS 10 (swift)
- How to add the parent path to RealmSwift.framework in the “Framework Search Paths” section?
- ios-Facebook SDK 3.0 Error 5 When Posting Status Update
- NSCache is not evicting data