• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSImage initWithContentsOfURL:
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: NSImage initWithContentsOfURL:
      • From: Scott Anguish <email@hidden>
  • Prev by Date: Any advantages of Unix formatting
  • Next by Date: Re: Any advantages of Unix formatting
  • Previous by thread: Re: Any advantages of Unix formatting
  • Next by thread: Re: NSImage initWithContentsOfURL:
  • Index(es):
    • Date
    • Thread