Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Open Handler, when is it called?



Steve Roy <email@hidden> wrote:

>At the start of my application, I initialize the things I need (including
>the two open handlers), then I enter a loop which calls Thread.sleep() until
>the openHandlerCalled flag is set to true. When the loop exits, I am 100%
>certain if I need to open a blank document or not. :)

Rather than a loop, use wait() and notify(). If you feel obligated to wake
up at the end of some "can't possibly happen" period of time, then use the
wait(long) method to get the effect of a timeout alarm.

-- GG




Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.