Re: ImageNamed not refreshing
Re: ImageNamed not refreshing
- Subject: Re: ImageNamed not refreshing
- From: Joe Zobkiw <email@hidden>
- Date: Tue, 01 Oct 2002 08:30:58 -0400
>
But, your copy method is a safer and cleaner solution. Just make sure you
>
release the old one when you're done with it. Don't just reassign the
>
pointer to a new copy or you'll have a memory leak.
Thanks Brock,
It seems like an autorelease might do the trick. Since I am immediately
assigning theImage to the NSImageView I presume it will retain it.
Therefore, I've done the following which seems to do the trick:
NSImage *theImage = [[[NSImage imageNamed:@"picture.tiff"] copy]
autorelease];
[m_imageView setImage:theImage];
[m_imageView setNeedsDisplay:YES];
Thanks for your input. Even though I "figured it out" it helps to have
someone reaffirm your solution. Thanks!
--
Joe Zobkiw
TripleSoft Inc.
email@hidden
_______________________________________________
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.