Passing NSArray from NSOperation to caller

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

  1. arnieterm macrumors regular

    Joined:
    Aug 28, 2008
    #1
    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?
    Thanks
    Arnieterm
     
  2. chown33 macrumors 604

    Joined:
    Aug 9, 2009
  3. PhoneyDeveloper macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #3
    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

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

Share This Page