objective-ciosmknetworkkit

MKNetworkKit: Chain of requests where each subsequent request needs data from the previous


i'm not sure how to implement this the best way:

i have multiple rest requests where each on retrieves data from a different resource. the thing is that each requests needs data from the previous one.

now i have mknetworkkit running in this project and do i really have to make a request, then evaluate the data in the result block and start a new one from this result block which in turn will end up in the next result block and so forth...

it is not really recursive since evaluation is different for every request and it seems to me that nesting request/block combinations ten levels deep is not really a nice way to do this (synchronous requests apparently are also bad and not supported in mknetworkkit).

what would be the best practice to do this?

EDIT: i also would like to do this in one function call


Solution

  • Same issue here. What I've ended up with is placing each desired network call in a queue (array or whatever you want to store your operations in) and updating my network response delegate so that it checks the queue for the next operation in the chain.