Re: [NSImage lockFocus] and threads
Re: [NSImage lockFocus] and threads
- Subject: Re: [NSImage lockFocus] and threads
- From: Michael Horn <email@hidden>
- Date: Sat, 21 Jul 2001 09:46:11 -0700
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.