xcodeviewhud

Update view and progress HUD whilest running method


I have a method that converts an xml to JSON objects and loops trough them to possibly import data in my sqlite3 database. Whilest running this method I would like to be able to let the user know how far (progress bar or circular) along the process the method is. But i can't seem to update the view until my methos is completely over.

Does anyone have an idea for this? I tried it almost all I guess.

Xml import setting progress percentage only here Hud is shown


Solution

  • Solved Run method in dispatch_sync(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND And all progress and screen updates in dispatch_sync(dispatch_get_main_queue(

    enter image description here