Search code examples
iosnsoperationnsoperationqueue

NSOperations and iOS architecture questions


I'm getting deeper into NSOperations stuff and I have question connected to iOS architecture:

*1.Is it possible in iOS system architecture to kill my NSOperations / NSOperationsQueue that I call?

*2.What can be done to do this? what kind of situation?

*3. What do iOS when is running on low resources and NSOperationQueue is allocated and init'ed with new NSOperations queued?

*4. As I read about NSOperations - they cannot run till get status isReady=YES to execute, or can get isReady=NO, if there are still unfinished operations on which it is dependent. What kind of dependent operations can it be?


Solution

  • 1) No, it will not do that, unless it kills your whole applications. In this case, you will be notified from - (void)applicationWillTerminate:(UIApplication *)application in your app delegqte

    2) N/A

    3) It will produce a low memory warning notification. See Low memory

    4) Operation queue will process all your NSOperations. NSOperations dependancies are only inducted by you. For "isReady" to be equal to NO, it would require you to change the value manually.