MugunthKumar/MKNetworkKit — Issue #61: Cancel all operations in sharedNetworkQueue
Author: SuperMario77
Created: 2012-02-21 17:00:39+00:00
State: open

Hi,

I took your demo, subclass the MKNetworkEngine and wrote some methods which hides all the network handling. So the consumer of my engine methods doesn't know anything about MKNetworkOperation.
Now, I want to stop all operations in the shared network queue, when the view will disappear (viewWillDisappear).
How can I do this?

I had the idea to add a "cancelAllOperations" method into my engine subclass, but from there I have no access to
_sharedNetworkQueue of MKNetworkEngine?

Do you think it would be a good idea to add the following method to MKNetworkEngine?

- (void)cancelAllOperations
{
for (MKNetworkOperation *operation in _sharedNetworkQueue.operations) {
[operation cancel];
}
}

Best regards,
Mario Sansone