Quitting Current Application

  • Hey,

    I am using Scripting Bridge to control iTunes within my application. I
    know how to quit iTunes while I am doing it, but if iTunes is quit
    before my application it freezes. I figured this out because I had a
    "Quit iTunes" option, but I would like to know how to quit my
    application through the code. So that I can do a twofer there.

    Thanks,
    Jeremy
    "Programming today is a race between software engineers striving to
    build bigger and better idiot-proof programs, and the Universe trying
    to produce bigger and better idiots. So far, the Universe is winning."
    - Rick Cook
  • > but I would like to know how to quit my
    > application through the code. So that I can do a twofer there.
    >
    You can use [NSApp terminate].

    Regards
    Shripada
  • Yes, it's [NSApp terminate:nil];

    On Jan 16, 2008, at 12:32 PM, Shripada Hebbar wrote:

    >
    >> but I would like to know how to quit my
    >> application through the code. So that I can do a twofer there.
    >>
    > You can use [NSApp terminate].
    >
    > Regards
    > Shripada

    =============================================
    Qi Liu
    E-Mail: <qliu...>
    --Stay Hungry. Stay Foolish.
    --You've got to find what you love.
    =============================================
  • Oh yes, I stand corrected:-)

    On 16-Jan-08, at 1:12 PM, Constantine wrote:

    > Yes, it's [NSApp terminate:nil];
    >
    > On Jan 16, 2008, at 12:32 PM, Shripada Hebbar wrote:
    >
    >>
    >>> but I would like to know how to quit my
    >>> application through the code. So that I can do a twofer there.
    >>>
    >> You can use [NSApp terminate].
    >>
    >> Regards
    >> Shripada
    >
    > =============================================
    > Qi Liu
    > E-Mail: <qliu...>
    > --Stay Hungry. Stay Foolish.
    > --You've got to find what you love.
    > =============================================
    >
    >
    >
    >
    >
  • Hamis,

    I know when I start of scripting bridge for iTunes, I can use [iTunes
    quit]; to quit iTunes. But with iTunes being quit my application
    stalls...

    This is where my problem is. How do I quit MY application (the one
    that is currently working) through objective-c.

    Jeremy
    "Programming today is a race between software engineers striving to
    build bigger and better idiot-proof programs, and the Universe trying
    to produce bigger and better idiots. So far, the Universe is winning."
    - Rick Cook
  • Look up NSApplication's terminate method.

    Jeremy wrote:
    > Hamis,
    >
    > I know when I start of scripting bridge for iTunes, I can use [iTunes
    > quit]; to quit iTunes. But with iTunes being quit my application
    > stalls...
    >
    > This is where my problem is. How do I quit MY application (the one
    > that is currently working) through objective-c.
    >
    > Jeremy
    > "Programming today is a race between software engineers striving to
    > build bigger and better idiot-proof programs, and the Universe trying
    > to produce bigger and better idiots. So far, the Universe is winning."
    > - Rick Cook
previous month january 2008 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