FROM : David Dunham
DATE : Sun Feb 17 22:50:06 2008
On 17 Feb 2008, at 05:02, Jonathan Dann wrote:
>> One wild guess is that the "guts" of -saveDocument: actually
>> happens in a delayed manner. Meaning it would get called after the
>> end of the current user event. Some of the action methods tend to
>> work this way. This seems to be reinforced by the error message
>> you're getting.
>
> You're right, a quick log above and below this show that it get
> called and then my -dataOfType:error: gets called some time after.
> So does it delay by spawning a new thread then?
Doubtful. That could introduce all sorts of threading issues, and the
delayed action is probably intended to let things settle down (i.e.
have all processing completed) before it happens. It's probably just
performSelector:withObject:afterDelay:.
> So do many other actions work in a delayed manner, and is it
> documented? Would I have missed this somewhere?
FWIW, this is likely an implementation detail that you can't rely on.
I know there were some things that changed between Tiger and Leopard,
with respect to being delayed or not (e.g. updateChangeCount:).
David Dunham A Sharp, LLC
Voice/Fax: 206 783 7404 http://a-sharp.com
Efficiency is intelligent laziness.
DATE : Sun Feb 17 22:50:06 2008
On 17 Feb 2008, at 05:02, Jonathan Dann wrote:
>> One wild guess is that the "guts" of -saveDocument: actually
>> happens in a delayed manner. Meaning it would get called after the
>> end of the current user event. Some of the action methods tend to
>> work this way. This seems to be reinforced by the error message
>> you're getting.
>
> You're right, a quick log above and below this show that it get
> called and then my -dataOfType:error: gets called some time after.
> So does it delay by spawning a new thread then?
Doubtful. That could introduce all sorts of threading issues, and the
delayed action is probably intended to let things settle down (i.e.
have all processing completed) before it happens. It's probably just
performSelector:withObject:afterDelay:.
> So do many other actions work in a delayed manner, and is it
> documented? Would I have missed this somewhere?
FWIW, this is likely an implementation detail that you can't rely on.
I know there were some things that changed between Tiger and Leopard,
with respect to being delayed or not (e.g. updateChangeCount:).
David Dunham A Sharp, LLC
Voice/Fax: 206 783 7404 http://a-sharp.com
Efficiency is intelligent laziness.
| Related mails | Author | Date |
|---|---|---|
| Jonathan Dann | Feb 16, 23:54 | |
| Scott Stevenson | Feb 17, 02:20 | |
| Jonathan Dann | Feb 17, 14:02 | |
| David Dunham | Feb 17, 22:50 | |
| Scott Stevenson | Feb 18, 23:27 | |
| Jonathan Dann | Feb 19, 00:17 |






Cocoa mail archive

