• 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: Distributed Objects, copying thereof
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Distributed Objects, copying thereof


  • Subject: Re: Distributed Objects, copying thereof
  • From: John Pannell <email@hidden>
  • Date: Thu, 8 Jun 2006 19:09:57 -0600

Hi Jim-

I have had similar issues with NSCachedImageRep in the past. I have never really understood why, but NSImages whose representation is NSCachedImageRep display strange behavior in some instances. My workaround has been this: do the programmatic image generation on one instance, and then make a second NSImage instance when I'm done via something like...

useableImage = [[NSImage alloc] initWithData:[sourceImage TIFFRepresentation]];

No insights into why the source image will not work, but I do know that making a "useable copy" of it in the above manner does work. I have an app that generates thumbnails by composing images together in a separate process and then sends the thumbs back to the parent application via DO.

Also (in case you really have no luck, and are using threads :-), be aware that if you are composing images in separate threads (not processes), the AppKit has a problem if the composed images share the same cache window for offscreen composing. There can be a race condition if an image has a lock to compose while another image needs to grow the cache window. This bit me hard some years ago...

http://www.cocoabuilder.com/archive/message/cocoa/2004/10/25/120154

HTH!

John


John Pannell Positive Spin Media http://www.positivespinmedia.com

On Jun 8, 2006, at 6:34 PM, Jim Thomason wrote:

Man, I just have no luck. Okay, so I implemented -
(id)replacementObjectForPortCoder:(NSPortCoder *)encoder in an NSImage
category to allow myself to pass NSImages with bycopy across a
distributed object connection. All was right.

Except I'm now have a different issue. It turns out that it works fine
when I have an image that was created via +imageNamed, but it fails
when I use an image I created programmatically in the code. So this
has lead me to believe that there's something different about my
programmatically created image and one returned by imageNamed, but I
haven't figured out what it could be.

So far I have:
1) tried explicitly calling setName: on my image.
2) added an NSBitmapImageRep to my newly created image.
3) added the NSBitmapImageRep AND removed the existing NSCachedImageRep.


None of those have had any effect - it still fails the same way as always.

Any suggestions as to what setting I should fiddle to make it work, or
if it's even possible?

-Jim......
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40positivespinmedia.com


This email sent to 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
References: 
 >Distributed Objects, copying thereof (From: "Jim Thomason" <email@hidden>)
 >Re: Distributed Objects, copying thereof (From: John Pannell <email@hidden>)
 >Re: Distributed Objects, copying thereof (From: "Jim Thomason" <email@hidden>)
 >Re: Distributed Objects, copying thereof (From: "Jim Thomason" <email@hidden>)

  • Prev by Date: Re: Distributed Objects, copying thereof
  • Next by Date: NSCFDictionary custom callbacks (Or: I Was Wrong)
  • Previous by thread: Re: Distributed Objects, copying thereof
  • Next by thread: Re: Distributed Objects, copying thereof
  • Index(es):
    • Date
    • Thread