performSelector queue & runloop schedule

64 Views Asked by At

I have read apple's code example ListAdder about how to use NSOperation. Technical Note TN2109 also explains the details.

If there is already an Operation calculating, and the user delete a data by remove a cell from the tableview, then the tableview delegate method will be called and tiggers new Operation to recalculate. I have drew a diagram to show this:

diagram shows the call sequence

question:

1.M1,M2,M3 will always be processed in one single loop?

2.function adderOperationDone was send to main thread to be executed via the performSelectorOnMainThread function, i know the selector will be added to the mainRunloop's queue, but when the queued will be executed?

3.Is there any circumstances that the M4 is inserted between M2 and M3?

0

There are 0 best solutions below