I have 2 methods:
-(void)clear
{
// some code
dispatch_async( dispatch_get_global_queue(0,0),
^{
// async_block_1
});
}
-(void)download
{
// some code
dispatch_async( dispatch_get_global_queue(0,0),
^{
// async_block_2
});
}
And I need call'em in 3rd method:
-(void)relosd
{
[self clear];
[self download];
}
How I can guaranted perform first async_block_1 then async_block_2?
Obvious that the following code does not guarantee this:
-(void)reload
{
dispatch_sync( dispatch_get_global_queue(0,0),
^{
[self clear];
[self download];
});
}
NSOperationQueue" thing with "setMaxConcurrentOperationCount:" set to 1?