Sharing NSOperationQueue across View Controllers?

后端 未结 3 1861
北恋
北恋 2021-01-31 06:06

I\'m using an NSOperationQueue to manage HTTP connections (using ASI-HTTPRequest). Since I have multiple views and the need to have these different views requesting HTTP connect

3条回答
  •  一生所求
    2021-01-31 06:41

    My personal preference for this is to have a singleton that manages all http requests. Each view would then ask the singleton to make the http call, passing itself as a delegate for that call then the singleton hands that delegate and call off to an NSOperation and then NSOperation calls back once the call is done.

提交回复
热议问题