I am calling this inside performBlock of my UIManagedDocument's managedObjectContext's parentContext. That is, it's on a background thread. Within the block I want to call requestMediaDataWhenReadyOnQueue synchronously. In the past , I could use dispatch_get_current_queue to pass as the parameter of requestMediaDataWhenReadyOnQueue. Now, how can I make it synchronous in the background thread of parentContext which I don't know how to get reference to it?
Asked
Active
Viewed 428 times
0
-
"making it synchronous" isn't what you are actually want to do. This is more an implementation detail. Also, I fear the solution will be asynchronous. Perhaps, you want to invoke an asynchronous method passing it a block which repeatedly gets invoked by `requestMediaDataWhenReadyOnQueue` and which is executed on the private queue of the managed object context? When everything is complete, you possibly want to get signaled via a completion function? – CouchDeveloper Mar 01 '14 at 09:09
-
@CouchDeveloper Thanks for your reply. Yes, exactly. I want to have it execute on the private queue of the managed object context. Is it possible to do without dispatch_get_current_queue? – John Mar 01 '14 at 09:19
-
You can execute any code on the private queue of a moc by passing a block to `performBlock:` and `performBlockAndWait:`. Still, it's unclear what you are trying to accomplish. What do you want to accomplish with the AVAssetWriterInput? And how is Core Data involved in the picture? – CouchDeveloper Mar 01 '14 at 10:13