You pass NSURL to your getContentAtURL, but then treat it as if it were a string:
NSURL * urlFinal = [NSURL URLWithString:[NSString stringWithFormat:@"%@", url]];
try changing it to:
NSURL * urlFinal = [NSURL URLWithString:[NSString stringWithFormat:@"%@", [url absoluteString]]];
btw, you know you don’t use your username and password, right?
EDIT:
When you say that receivedData = [NSMutableData data]; What is data?
I think this may be a problem.
I want to use the following to set up a data object when data first arrives:
- (void)connection:(NSURLConnection *)theConnection didReceiveData:(NSData *)incrementalData { if (receivedData ==nil) { receivedData = [[NSMutableData alloc] initWithCapacity:2048]; } [receivedData appendData:incrementalData]; }
source share