• 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: Pointers and NSImages
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Pointers and NSImages


  • Subject: Re: Pointers and NSImages
  • From: Gregory Weston <email@hidden>
  • Date: Thu, 2 Nov 2006 13:14:40 -0500

Lorenzo wrote:

Hi,
I create my picture

    myPict = [[NSImage alloc] init...

Then many other objects use this picture.

    [rectangle usePicture:myPict];
    [circle usePicture:myPict];

When the user changes the picture I have to update the picture in all the
objects. Instead I would like to use pointers and avoid to relink all the
objects to the new picture all the time.

Make the picture a property of some centralized object, or a singleton in its own right, and reference that object from within your other classes instead of trying to cache the NSImage explicitly.


Greg


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Prev by Date: Re: Open my Application via safari
  • Next by Date: Re: Re: Re: Open my Application via safari
  • Previous by thread: Re: Pointers and NSImages
  • Next by thread: Re: Pointers and NSImages
  • Index(es):
    • Date
    • Thread