-[NSApplication requestUserAttention:] return value?

  • The documentation for -[NSApplication requestUserAttention:] says:

    The value returned by this method can be used to manually cancel a
    request by passing it as the parameter to cancelUserAttentionRequest:.

    But it doesn't document the range of values returned. Empirically, it
    appears to be [0..N].

    Can anyone confirm that to be the case? It would be nice to have an
    uninitialized/no-request value that I can stuff in my iVar rather
    than tracking whether I have an outstanding notification request
    separately.

    Jim
  • On Nov 7, 2007, at 8:39 AM, Jim Correia wrote:

    > The documentation for -[NSApplication requestUserAttention:] says:
    > The value returned by this method can be used to manually cancel a
    > request by passing it as the parameter to cancelUserAttentionRequest:.
    > But it doesn't document the range of values returned. Empirically,
    > it appears to be [0..N].
    >
    The value increments each time you ask for a request.

    mmalc
  • On Nov 7, 2007, at 11:54 AM, mmalc crawford wrote:

    > On Nov 7, 2007, at 8:39 AM, Jim Correia wrote:
    >
    >> The documentation for -[NSApplication requestUserAttention:] says:
    >> The value returned by this method can be used to manually cancel
    >> a request by passing it as the parameter to
    >> cancelUserAttentionRequest:.
    >> But it doesn't document the range of values returned. Empirically,
    >> it appears to be [0..N].
    >
    > The value increments each time you ask for a request.

    So assuming I make less than 2 billion requests per application
    launch :-), -1 is a safe "uninitialized" value?

    Jim
  • On Nov 7, 2007, at 8:58 AM, Jim Correia wrote:

    >> The value increments each time you ask for a request.
    >
    > So assuming I make less than 2 billion requests per application
    > launch :-), -1 is a safe "uninitialized" value?
    >
    Urgh, not necessarily.  You might try -2...
    Could you file a documentation enhancement request and we'll try to
    get an official statement (I'm not sure if the person responsible
    might be willing to say anything now?).

    mmalc
previous month november 2007 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    
Go to today