• 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: [NSImage lockFocus] and threads
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [NSImage lockFocus] and threads


  • Subject: Re: [NSImage lockFocus] and threads
  • From: Aki Inoue <email@hidden>
  • Date: Sun, 22 Jul 2001 23:36:01 -0700

Micheal,

Yes, basically NSControl/NSCell access is not thread-safe.
You have to protect them if you modify/access from multiple threads.

Aki

On 2001.07.21, at 09:46, Michael Horn wrote:

Thank you for all your help. The problem ended up being that I was reading from a NSTextField with multiple threads and every now and then the intValue of the NSTextField would return 0. It seems that reading NSTextFields is not thread safe.

I put in some NSLocks and now everything works beautifully.


At 1:03 AM -0700 7/21/01, Aki Inoue wrote:
Michael,

That exception could be raised with either of the two reasons.

1) The size of the image is either 0.0 or ridiculously large number
2) Or, AppKit is somehow screwed up

With 2) case, you should get a log message like "No cache for representation" in the console.

If you're not seeing it, then, maybe your functions is passed 0 for iconWidth.

Aki

On 2001.07.21, at 00:43, Michael Horn wrote:

Adding the following line to the NS_HANDLER:

NSLog(@"exception name: %@ reason: %@ userInfo: %@", [localException name], [localException reason], [localException userInfo]);

results in:

exception name: NSImageCacheException reason: Can't cache image userInfo: (null)

What I really don't understand is I get this expection for different files at different times. If it was just a couple files, then it might make some sense. Any ideas?

Thanks again.
_______________________________________________
cocoa-dev mailing list
email@hidden
http://www.lists.apple.com/mailman/listinfo/cocoa-dev


References: 
 >Re: [NSImage lockFocus] and threads (From: Michael Horn <email@hidden>)

  • Prev by Date: Re: Goofy NSDrawer behavior
  • Next by Date: Thread Safty Deja Vu (retain/autorelease or lock/unlock?)
  • Previous by thread: Re: [NSImage lockFocus] and threads
  • Next by thread: Re: [NSImage lockFocus] and threads
  • Index(es):
    • Date
    • Thread