• 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
Re: NSURL Tutorial?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSURL Tutorial?


  • Subject: Re: NSURL Tutorial?
  • From: Jeff LaMarche <email@hidden>
  • Date: Sun, 28 Oct 2001 12:02:21 -0800

There's really not much to it. Here's a method from one of my objects that sounds pretty much like what you're tying to do.

imageURL is an NSURL IV.
imageData is an NSData IV.
image is an NSImage IV.

//----------------------------------------------------------------------
-(void)fetchImage
//----------------------------------------------------------------------
{

// I can't explain why, but
//
// [[NSImage alloc] initWithContentsOfURL: imageURL] doesn't
//
// work, but this does...

imageData = [NSData dataWithContentsOfURL:imageURL];
[imageData retain];
image = [[NSImage alloc] initWithData:imageData];

}

On Sunday, October 28, 2001, at 11:36 AM, Brian Moore wrote:

Can anyone help me on how to use NSURL to retrieve an image of the net and display it into a NSImageView? It's probably very simple, but I am somewhat new to cocoa and would appreciate some help..

Thanks in advance,
Brian Moore
_______________________________________________
cocoa-dev mailing list
email@hidden
http://www.lists.apple.com/mailman/listinfo/cocoa-dev


  • Follow-Ups:
    • Re: NSURL Tutorial?
      • From: Scott Anguish <email@hidden>
    • Re: NSURL Tutorial?
      • From: "Steven W. Riggins" <email@hidden>
References: 
 >NSURL Tutorial? (From: Brian Moore <email@hidden>)

  • Prev by Date: Re: Whats Wrong?
  • Next by Date: Re: NSURL Tutorial? (oops, answer part 2)
  • Previous by thread: NSURL Tutorial?
  • Next by thread: Re: NSURL Tutorial?
  • Index(es):
    • Date
    • Thread