I extend NSOperation (call it A) which contains NSOperationQueue for other NSOperations (which is another extended class different from A, call these operations B). When operation A is running (executing B operations) how do i call a specific function/method on operation A when certain event takes place on B operations? For example every operation B that finishes it calls a function on operation A returning itself?
*Nested NSOperation and NSOperationQueue(s)
Hope this mockup pseudo code can help to draw the picture.
//My classes extended from NSOperation
NSOperation ClassA
NSOperation ClassB
//MainApp
-(void)applicationDidFinishLaunching:(NSNotification *)aNotification {
ClassA A1;
ClassA A2;
NSOperationQueue Queue;
Queue AddOperation: A1;
Queue AddOperation: A2;
}
//Main of ClassA
-(void)main {
ClassB B1;
ClassB B2;
NSOperationQueue Queue;
Queue AddOperation: B1;
Queue AddOperation: B2;
}
//Main of ClassB
-(void)main {
//Do some work and when done call selector on ClassA above
}