Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Persisting NSOperationQueue

Does anyone know how to persist an NSOperationQueue to disk between application launches?

like image 846
ByteLock Avatar asked Sep 04 '10 21:09

ByteLock


1 Answers

There's no way to do so. NSOperations are actions, parts of runnable code, that are impossible to generically persist to disk.

However, in your application you should know what operations you added to the queue. Either by using a subclass or by having some metadata around. You'd then store the metadata, the information about what should be done, in a custom way. Upon application launch the actions that previously were in the queue can now be re-created from the loaded metadata.

There is hardly anything else I can give you at the moment, but I hope that was helpful already!

like image 106
Max Seelemann Avatar answered Oct 10 '22 11:10

Max Seelemann