I know I can just use UIImage imageNamed:
But how would I do it using file paths? I've tried many variations of this:
But how would I do it using file paths? I've tried many variations of this:
Code:
NSString* imgName = @"test.png";
NSString* resourcePath = [[NSBundle mainBundle] resourcePath];
NSURL *url = [NSURL fileURLWithPath:[resourcePath stringByAppendingString:imgName]];
NSURLRequest* request = [NSURLRequest requestWithURL:url cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:60.0];
connection = [[NSURLConnection alloc] initWithRequest:request delegate:self];