iOS Development Help

Associate
Joined
25 Feb 2007
Posts
905
Location
Midlands
Hi,

Can any iOS devs help me with this?

I'm downloading and parsing a JSON feed on a button press. This button also loads the next view (via a storyboard segue)

I'm getting an error about a thread other than the main one trying to update the UI - I'm assuming that this is because I'm using a secondary thread to download and parse the file and then the UI change also occurs in the secondary thread.

How can I force the UI change to occur in the main thread? The button has to control both actions (downloading/parsing the file and the UI change) as a parameter for the JSON download is created using a text box value on the same view.

Thanks!
 
Hi mate,

Sorry it's taken me a while to come back to you on this!

I've tried to implement what you've suggested, but it doesn't seem to have made any difference.

I think it's because I don't actually change the view in the code anywhere - I've got the code under where I've created a new queue to pull through my JSON data, but then I don't have anything to put under the get_main_queue part as all of the view switching is done in the Storyboard?

Do I need to add code to change the view, or should I leave it with the storyboard to sort out, and fix this some other way?
 
Back
Top Bottom