Login form starting NSInvocationOperation dilemma

Discussion in 'iOS Programming' started by Denvildaste, Apr 29, 2010.

  1. Denvildaste macrumors newbie

    Joined:
    Apr 7, 2010
    #1
    Hello,

    I have a simple login form in my application, when I press login I simply want the login button to get disabled.

    When I press the button I call a function, inside it I disable the button and call a NSInvocationOperation that invokes the login code, that works so far.

    The login code loads a new view controller on success, that view controller is technically running in the operation that I spawned and not the main thread, I don't know if that's the best practice but I don't mind much, my problem is that I can't start any timers from my new view controller (the timer code works fine if I load the login page from the main thread, but if I do that I can't disable the login button until the login code is finished).

    Any ideas how to solve this? or any better implementations? any help would be appreciated
     
  2. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #2
  3. Denvildaste thread starter macrumors newbie

    Joined:
    Apr 7, 2010
    #3

    Thanks man that was an elegant solution, bounced my code flow back into the main thread and everything worked great, right now I'm making sure the thread won't be editing any part of the UI.
     

Share This Page