BOUNTY NOTICE
Hello! I started bounty on this question because people don't read whole question and don't try to understand root of the problem. Or, don't know what is going on here. More detailed approach needed.. Thank you!
END
When I call NSURLSession with my custom task - I store those tasks in a dictionary. When I get delegate calls back I need to find which task is it about. Here is how I do it:
- (NSInteger)getOperationIdentifierForTask:(NSURLSessionTask*)task
{
for (NSString *key in self.operations)
{
HttpTaskOperation *value = [self.operations objectForKey:key];
if (value.task == task) return [key integerValue]; //**********
}
return 0;
}
It DID work for me previously (with iOS7 for sure) but now this comparison never succeeds. I also pulled screenshot from locals, see object id's highlighted. Yes, I'm not C developer so it might be related to issue :) I assume it's due to pointer issue..
When line of code with //***** executes - I don't get match. This function always returns 0.
EDIT:
Seems like issue related to PROXY. iOS when I create and store NSURLSession actually returns NSProxy. Same for NSUURLSessionTask.
Is this all something new and how can I compare those objects given what you see in locals? I need to get task._taskDelegate
but it's not exposed..