Use ASIIHTTPRequest to request the BLOB data from that PHP page.
With the BLOB data, convert it to a UIImage.
- (void) getBlobData:(NSURL *) url {
NSURL *url = [NSURL URLWithString:url];
__block ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url];
[request setCompletionBlock:^{
NSData *blobData = [request responseData];
UIImage *blobImage = [UIImage imageWithData:blobData] retain];
[someImageView performSelectorOnMainThread:@selector(setImage:)
withObject:blobImage
waitUntilDone:YES];
}];
[request setFailedBlock:^{
NSError *error = [request error];
}];
[request startAsynchronous];
}
Alternatively, you could use Grand Central Dispatch (GCD) to send a request to the web-page in order to receive the blob:
- (void) getBlobData:(NSURL *) url {
dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0ul);
dispatch_async(queue, ^{
NSData *blobData = [NSData dataWithContentsOfURL:url];
UIImage *blobImage = [UIImage imageWithData:blobData];
dispatch_sync(dispatch_get_main_queue(), ^{
[someImageView setImage:blobImage];
});
});
}