I am making a call to a service from a main thread, and getting the results. But when the same call is made from background, i am not getting results. Any thoughts?
Here is my code :
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT,
(unsigned long)NULL), ^(void) {
self.pathRequest = [[PathRequest alloc] initWithUserId:[userInfobase userId]
self.pathRequest.target = self;
self.pathRequest.successSelector = @selector(success:);
self.pathRequest.errorSelector = @selector(failure:);
[self.pathRequest execute];
});
In my class PathRequest, i have defined delegate methods for handling server response
- (void) execute
{
[restClient loadData:@"/path"];
}
- (void)restClient: (AFRestClient *) client loadedData: (AFMetaData *) metadata {
}