CheckEventQueueForUserCancel() equivalent in Cocoa ?

  • Hi,

    everything is in the subject, what's the equivalent for CheckEventQueueForUserCancel() in Cocoa ?

    Thanks.

    --
    Keep intel OUTSIDE my Mac !
    Hiii !!! I can see Intel chips creeping around my G5 !

    Eric M.
  • On Jul 3, 2012, at 10:16 AM, Eric Matecki wrote:

    > everything is in the subject, what's the equivalent for CheckEventQueueForUserCancel() in Cocoa ?

    There are multiple ways to implement a user cancel operation, depending on your design. Probably the easiest way to do it is to put your worker-thread code in a subclass of NSOperation, and call -cancel on it if the user clicks on your Cancel button or does something else that should cancel the operation. You can then check the isCancelled property of the NSOperation in your worker code to determine if the operation is cancelled or not.

    > Keep intel OUTSIDE my Mac !
    > Hiii !!! I can see Intel chips creeping around my G5 !

    A little late for that, don’t you think?

    Charles
  • On 03/07/12 22:23, Charles Srstka wrote:
    > On Jul 3, 2012, at 10:16 AM, Eric Matecki wrote:
    >
    >> everything is in the subject, what's the equivalent for CheckEventQueueForUserCancel() in Cocoa ?
    >
    > There are multiple ways to implement a user cancel operation, depending on your design. Probably the easiest way to do it is to
    > put your worker-thread code in a subclass of NSOperation, and call -cancel on it if the user clicks on your Cancel button or does
    > something else that should cancel the operation. You can then check the isCancelled property of the NSOperation in your worker
    > code to determine if the operation is cancelled or not.
    Thanks. That won't be easy because our software is multiplatform and that may need big changes.
    Anyway, I will look at it to see if it is doable without disrupting all the crossplatform stuff.

    >> Keep intel OUTSIDE my Mac !
    >> Hiii !!! I can see Intel chips creeping around my G5 !
    >
    > A little late for that, don’t you think?
    Yes, unfortunaely... I prefer reading numbers from left to right :)
    Good old trusty G5 is now only fired up before release to check if the app still runs on it.

    --
    Keep intel OUTSIDE my Mac !
    Hiii !!! I can see Intel chips creeping around my G5 !

    Eric M.
previous month july 2012 next month
MTWTFSS
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31          
Go to today