Well, you're already using
dispatch_async
. Then you should just use dispatch_async(dispatch_get_main_queue(),^ { ... } );
from inside your background thread to perform things on the main thread. For example,
if ([self testServerMethod])
{
dispatch_async(dispatch_get_main_queue(),^ {
[self showMessageBoxWithString: @"Server is working!"];
[self threadedUIActivityRemover:nil];
} );
}else ...
This way of calling
dispatch_get_main_queue()
And then performing UIKit-related stuff is really smooth and much more versatile then performselectoronmainthread.
So, that's an update to the hole Threading-colundrum. Now on to new things.
I'm still writing on Quizer as much as I can. And it's slowly starting to take form. Next week I hope to have time to tackle the main logics of the game itself. And thats really something I'm looking forward to.
To be able to run the app 24/7 I've invested in a small NAS that run Apache and MySql. It will be fun to see how it will handle high traffic-load etc. I'll come back to you regarding that when I'm testing the app in a few weeks!
Today I'm in school programming with my friend Ludvig. He's not the most inspired programmer today.. but after all it's sunday..
Ludvig at work! |
//Code on!
Inga kommentarer:
Skicka en kommentar