0

I understand that the calls are async to the main thread, but will the multiple blocks be called in order? Is the block/operation queue guaranteed to be shared? Are they started off in separate threads? Or will the finish in order as well?

Or is this something that should not be counted on at all?

I see there are a number of questions on SO (and the interwebs at large) that people typically just nest blocks. That feels definitely "ugly" to me. I am in pursuit of a more elegant solution and came up with the above question.

Note I am not interested in enforcing order, only wondering if the framework has the documentation regarding order, if any.

SO question that asks another related question: How to avoid nested blocks

Community
  • 1
  • 1
chrisp
  • 2,181
  • 4
  • 27
  • 35
  • An example would be adding an image to a custom album. I know the examples exist on the interwebs, my concern is not how it's done but if there's a better way to handle the nested blocks. It's 3 nested blocks -- in the completion block of the image saving you have to have a completion block for adding the group (making sure it exists) and then adding it to that album. /ugly – chrisp May 17 '14 at 05:09
  • The documentation in ALAssetsLibrary is quite silent regarding this. AV Foundation at least makes a clear statement. The solution to your issue (if any) is to dispatch on your _own_ queue within the completion block. – CouchDeveloper May 19 '14 at 19:23
  • What do you mean dispatch to my own queue? Typically I'm just dispatching to the main thread (for ui). – chrisp May 19 '14 at 21:26

0 Answers0