Re: Getting Image from Web and Displaying it problem
Re: Getting Image from Web and Displaying it problem
- Subject: Re: Getting Image from Web and Displaying it problem
- From: David Remahl <email@hidden>
- Date: Fri, 24 Jan 2003 16:44:04 +0100
Oh, I didn't consider that. initWithContentsOfURL: apparently uses the
cache. You should go back to using your old method of first loading an
NSData and then initing the image with that.
You are doing the right thing, releasing the image after setting the
image view image. The image view will retain the image, so it is safe
for you to release it. Since you alloced it, you need to release it.
/ Regards, David
Hmm. Spoke too soon. The below code works - the first time. When I
click the button to reload the image, it doesn't load the updated
image (which I know has changed by looking at the original website).
The old code does refresh the image. It must be caching it somewhere
and not reloading it.
On Fri, 24 Jan 2003 14:27:33 +0100
David Remahl <email@hidden> wrote:
Nope, it is perfectly ok to do:
NSString *str = @"whatever";
I'm not sure what the original poster's problem might be. The code
looks ok. Are you sure the image you are downloading isn't corrupt?
You could also try;
NSImage *image = [[NSImage alloc] initWithContentsOfURL:[NSURL
URLWithString@"http://www.rccl.com/rc/image/vywebcam.jpg"]];
The image will then be downloaded from the URL automatically.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.