¿Cómo NSURLConnection devuelve la llamada en el mismo hilo?

How does NSURLConnection asynchronous request gives its callbacks on the same thread it was called from?

If I have to design a worker class that would take some work off the calling thread and when it is done it would give the completion callback on the same thread that it was called from, How would I do that?

typedef void (^BasicTask)(void);

@protocol WorkerDelegate
- (void)taskDidSucceed;
- (void)taskDidFailWithError:(NSString *)errorDescription;
@end

@interface Worker {
    id <WorkerDelegate> delegate;
}
-(void)performTaskInBackground:(BasicTask)task;
@end

preguntado el 15 de mayo de 13 a las 04:05

Thank you @JoshCaswell, I will take a look. -

0 Respuestas

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.