I want to add operation into executing request. I read about ASINetworkQueue, but it adds all operation and run it all. but i want to add operation into running queue.
Is this possible? using ASIHTTPRequest or AFNetworking i don’t mind, as long as i get what i intend to do.
EDIT
It shows below error while i try to add another request.
[ASINetworkQueue addOperation:]: operation is executing and cannot be enqueued’
From the apple documentation for
addOperation:it is clear that you cannot add an operation which is executing into aNSOperationQueue.This is what mentioned there,
An operation object can be in at most one operation queue at a time and this method throws an NSInvalidArgumentException exception if the operation is already in another queue. Similarly, this method throws an NSInvalidArgumentException exception if the operation is currently executing or has already finished executing.
That is the default behavior of
NSOperationQueue. You need to make sure that theNSOperationis not executing before adding to queue. There are various properties such asisExecuting,isFinishedetc.. to check this.