OK, I have done some reading and I am actually a step further now.
This is the flow:
- I call the
from the AppDelegate
- in the DataAccess class is the method startLoadingURL called and I have as test printed the URL out to se that it is delivered properly.
- from the startLoadingURL method are the chain of connection delegate methods called and it all ends up with the
From this method is the, in the AppDelegate
called. I have checked it all by using NSLog and I can see that all methods are called as intended.
Now the problem:
The url send to startLoadingURL in the DataAccess class is ok, but in all other methods is the url set to null... I mapped the url to the connection in the startLoadingURL method like this:
And to send it back to the delegate later on in theconnectionDidFinishLoading i did the following:
I suppose I missed something here and perhaps you could give me a hint on what it may be?
Thanks in advance!
MACloop
This is the flow:
- I call the
Code:
[[DataAccess sharedDataAccess] startLoadingURL:[NSURL URLWithString:@"http://www.somthing.com"] withDelegate:self];
- in the DataAccess class is the method startLoadingURL called and I have as test printed the URL out to se that it is delivered properly.
- from the startLoadingURL method are the chain of connection delegate methods called and it all ends up with the
Code:
(void)connectionDidFinishLoading:(NSURLConnection *)connection
From this method is the, in the AppDelegate
Code:
- (void) wasLoadedForURL:(NSURL *) url data:(NSData *)d
called. I have checked it all by using NSLog and I can see that all methods are called as intended.
Now the problem:
The url send to startLoadingURL in the DataAccess class is ok, but in all other methods is the url set to null... I mapped the url to the connection in the startLoadingURL method like this:
Code:
[connectionToUrl setObject:url forKey:myConnection];
And to send it back to the delegate later on in theconnectionDidFinishLoading i did the following:
Code:
NSURL *u = [connectionToUrl objectForKey:connection];
I suppose I missed something here and perhaps you could give me a hint on what it may be?
Thanks in advance!
MACloop