NSImage initWithContentsOfURL:
NSImage initWithContentsOfURL:
- Subject: NSImage initWithContentsOfURL:
- From: Matt Judy <email@hidden>
- Date: Mon, 03 Sep 2001 16:59:46 -0700
- Organization: Apple
Hey,
I've got the following code (some names have been changed to protect the innocent):
- (void)displayMyImage
{
NSURL *myImageURL = [self methodThatReturnsAnNSURL];
NSImage *myImage = [[NSImage alloc] initWithContentsOfURL:myImageURL];
NSLog(@"myImageURL: %@",myImageURL);
NSLog(@"myImage: %@",myImage);
[imageView setImage:myImage];
[imageView setNeedsDisplay];
}
imageView is an outlet to an NSImageView. myImage is not getting drawn into imageView.
The NSLog for myImageURL returns a URL to an image, which I can verify in a web browser.
The NSLog for myImage returns (null). This seems fairly straightforward... What am I
doing wrong?
Thanks!
--
Matt Judy