My Blog List

Android FirstAid Coding

A Small Help From a Small Heart
Powered by Blogger.

A software professional, who still likes to code, likes to blog and loves gadgets.

Wednesday 17 July 2013

How to start a thread in IOS

//Start an activity indicator here
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
    //Call your function or whatever work that needs to be done
    //Code in this part is run on a background thread
    dispatch_async(dispatch_get_main_queue(), ^(void) {
        //Stop your activity indicator or anything else with the GUI
        //Code here is run on the main thread
    });
});

1 comment: