Advertise here




Advertise here

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

NSTimers In the Rows of UItableView

RashiMahajanRashiMahajan Posts: 21Registered Users
edited November 2010 in iPhone SDK Development
HI,
In my application, on the each row i have to place a button which will allow the user to start the timer for that row & then he can stop the timer by button click and then has to update the time on label. Now I am not able to decide what strategy i should adopt for doing this. Should i create the individual timer for each row or with one timer i should control all the rows...
If any one has the promo code please share also ....
Thanks in Advance .......
Post edited by RashiMahajan on

Replies

  • Oliver DrobnikOliver Drobnik Vienna, AustriaPosts: 538New Users, Registered Users @ @ @
    edited November 2010
    HI,
    In my application, on the each row i have to place a button which will allow the user to start the timer for that row & then he can stop the timer by button click and then has to update the time on label. Now I am not able to decide what strategy i should adopt for doing this. Should i create the individual timer for each row or with one timer i should control all the rows...
    If any one has the promo code please share also ....
    Thanks in Advance .......

    Sounds to me as if those Timers are part of your "model" whereas the table view is only a representation. I would suggest you bundle the central application logic and model into an engine singleton class and have the timers communicate with the table view controller via notifications.

    See here on how to make a singleton class: The Death of Global Variables @ Cocoanetics

    See here on how to use notifications: Love to be Notified! @ Cocoanetics
    Buy my book "Barcodes with iOS 7": http://bitly.com/barcodes_iOS

    Get 50% until March 9th with promo code "mldrobnik"
Sign In or Register to comment.