Hey Shod,
I finally found the problem, I didn't provide the right argument type I needed to provide an NSURL. And I tried to connect twice in the loadImageFromURL.
The improved function:
- (void)loadImageFromURL

NSURL*)url {
if (![NSThread isMainThread]) {
[self performSelectorOnMainThread:@selector(loadImageFro mURL

withObject:url waitUntilDone:NO];
return;
}
if (connection!=nil) { [connection release]; } //in case we are downloading a 2nd image
if (data!=nil) { [data release]; data = nil;}
NSURLRequest* request = [NSURLRequest requestWithURL:url cachePolicy: NSURLRequestUseProtocolCachePolicy timeoutInterval: 30.0];
//This makes it possible to scroll while the images are being loaded
connection = [[NSURLConnection alloc] initWithRequest: request delegate: self startImmediately: NO];
[connection scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSRunLoopCommonModes];
[connection start];
}
Thanks for all the help and tips!