Search code examples
iphoneiosbackground-processnsoperationnsoperationqueue

NSOperationQueue background process in iPhone?


I am new in NSOperationQueue, I need to call web-service in background process using NSOperationQueue, how to do that, please help me. I have spend more time for this.

Thanks in Advance


Solution

  • For the OperationQueue-Part try

    NSOperationQueue *q = [[NSOperationQueue alloc] initWithBlock:^{
    //your code here
    //and here ;)
    }];
    

    It will start automatically. For more on OperationQueues, look at the docs: https://developer.apple.com/library/mac/#documentation/cocoa/Reference/NSOperationQueue_class/Reference/Reference.html