I have an iOS app where 5 NSBlockOperation produce an NSArray of objects each and add it to a shared synchronized NSMutableArray which serves as a UITableView datasource.
The operation are independent from each other, and as soon as they have finished I need to launch a UITableView data reload.
Unfortunately I couldn't find a way to do this with NSOperation. Do I need to use another multi thread design ?
Add your reload data call to yet another NSOperation, which has as its dependencies (see
addDependency:
) the other five operations. It will then not be executed until the others are complete.Be sure to wrap your UI calls in a GCD dispatch to the main thread.
From the NSOperation reference: