Passing NSArray from NSOperation to caller

Discussion in 'iOS Programming' started by arnieterm, Nov 26, 2010.

  1. arnieterm macrumors regular

    Aug 28, 2008
    I have created an NSOperation subclass that performs a long task. Created an instance of that subclass and added to an NSOperationQueue. The subclass is processing a long task and result a series of NSArray that I need to pass back to caller. Though I am using KVO method to notify the main thread that there is something [NSArray] ready for main thread.
    What is the proper way to share information like NSArray between NSOperation and its caller?
    Any idea?
  2. chown33 macrumors 604

    Aug 9, 2009
    Sailing beyond the sunset
  3. PhoneyDeveloper macrumors 68040


    Sep 2, 2008
    Use performSelectorOnMainThread and send the array as the object. I've discussed this recently in a thread on this forum.
  4. arnieterm thread starter macrumors regular

    Aug 28, 2008
    Thanks for the reply
    Can you point me to your post where the discussion on NSOperation takes place

Share This Page