I am trying to load an image and display it into an NSImageView. The image is located somewhere in my computer. But I am having some problems. Here is my code.
It seems that the image is not initialized. Does anyone know why? I am assuming there is something wrong with my NSUrl methods...
Code:
-(void)loadImageFromPath:(NSString *)aPath
{
NSURL *url = [NSURL fileURLWithPath:[aPath stringByStandardizingPath]];
NSLog([url absoluteString]);
CIImage *currentImage = [CIImage imageWithContentsOfURL:url];
if (currentImage == nil) {
NSLog(@"failed to initialize the image");
}
mainImage = currentImage;
}
It seems that the image is not initialized. Does anyone know why? I am assuming there is something wrong with my NSUrl methods...