Saturday 18 August 2018

Dispathch Queue

dispatch_queue_t jsonParsingQueue = dispatch_queue_create("jsonParsingQueue", NULL);


// execute a task on that queue asynchronously
dispatch_async(jsonParsingQueue, ^{

      [self citySearchArrayMethod]; // populates the city table with city list

    // some code on a main thread (delegates, notifications, UI updates...)
    dispatch_async(dispatch_get_main_queue(), ^{

      [self.tableView reloadData]; // load the table with data

    });
});