ios - How to call a method in another thread? -


I have a tableview, but when I scroll to the table, my timer has to be stopped while scrolling and scrolling After calling it, I want to call that timer in the second thread.

  // This is my timer. [NSTimer Scheduled Timer WithTime Timeline: 1.0 Target: Self Selector: @Selector (TimerColded) userInfo: Zero Replay: Yes]; // This is another thread method I am trying to do this, but its not working dispatching_accept (send_gate_global_que (DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^ {[self timercalled;;});   

Can anyone suggest me?

NSTimer Usually when a table or other UIScrollView is scrolling, So there is no fire ??? Or by doing anything while placing a run loop in event tracking mode

when we define a timer:

  [NSTimer scheduled timer with time interval: 0.5 targets: Self selector: @ selector (call_a_method :) userInfo: zero repeats: yes];   

The timer is added to the default run loop mode, which is NSDefaultRunLoopMode which means your timers will be effectively stabilized when the default run loop mode holds Will be done.

If you want to run a timer while scrolling your table, do this:

  NSTimer * timer = [NSTimer timer with time interval: 1.0 target: auto selector: @sillector (timer-matched) user information: zero repeats: yes]; [[NSRunLoop mainRunLoop] addTimer: Mode for Timer: NSRunLoopCommonModes];   

Hope this helps .. :)

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -