• 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: ImageNamed not refreshing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: ImageNamed not refreshing
      • From: "John C. Randolph" <email@hidden>
  • Prev by Date: Re: C++ mixed with Cocoa
  • Next by Date: Re: (newbie)sun vs. apple....
  • Previous by thread: Re: C++ mixed with Cocoa
  • Next by thread: Re: ImageNamed not refreshing
  • Index(es):
    • Date
    • Thread