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

Pointers and NSImages


  • Subject: Pointers and NSImages
  • From: Lorenzo <email@hidden>
  • Date: Thu, 02 Nov 2006 16:37:34 +0100

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. Something like I set once forever:

    [rectangle usePicturePtr:&myPict];

But this doesn't work. Any time I reallocate a new picture I lose the
previous pointer and get a new one.
How should I do?


Best Regards
--
Lorenzo
email: email@hidden

 _______________________________________________
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

  • Follow-Ups:
    • Re: Pointers and NSImages
      • From: Fritz Anderson <email@hidden>
  • Prev by Date: Re: Prevent DVD Player launch
  • Next by Date: Re: Simulate Photoshop's "Overlay" compositing method
  • Previous by thread: Re: Simulate Photoshop's "Overlay" compositing method
  • Next by thread: Re: Pointers and NSImages
  • Index(es):
    • Date
    • Thread