2

I need to call multiple web services in a loop for uploading and downloading the data for application.(Known as Sync Process)

I am using AFHTTPSessionManager and create a subclass/wrappper class for that. I need to do something in a que or creating batch request for that.

I am stuck at this from last night.

Thanks in advance.

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Anurag Dixit
  • 119
  • 2
  • 16

1 Answers1

1

For this kind of funcionalities probably an AFHTTPRequestOperationManager is a better choice.
SessionManager relies on tasks, tasks don't have the knowledge of dependency between each other, while operations does.
You have different possibilities:

  • Wrap sessions into a dispatch_group take a look here
  • Try to embed a session task inside an NSOperation (really hard)
  • Use AFHTTPOperation and add dependencies between operations
  • Use a serial queue on GCD

You might find also this answer helpful

Community
  • 1
  • 1
Andrea
  • 26,120
  • 10
  • 85
  • 131