Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6114033
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:55:40+00:00 2026-05-23T14:55:40+00:00

I managed to create a bug where a cocoa program is exiting. -[NSApplication terminate:]

  • 0

I managed to create a bug where a cocoa program is exiting.

-[NSApplication terminate:] is apparently not called.

Nor is -[NSException init].

There is no crash. What I am seeing in gdb is that exit() is being called directly from NSApplicationMain without going through the normal [NSApplication terminate] path.

Any ideas about how to debug this and/or how this (seemingly “impossible” behavior) could happen?

Thanks in advance from a cocoa newb.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T14:55:40+00:00Added an answer on May 23, 2026 at 2:55 pm

    After mulling this over I guessed that I was doing something wrong “in the big picture”. So, “in the big picture”, what I was doing is calling a modal dialog (by loading a window nib, showing the window and then using [NSApplication beginModalSessionForWindow]…[NSApp runModalSession]… and upon close [NSApp endModalSession]. This has worked for me in other chunks of code no big deal. The critical difference was that this modal window was being loaded and run out of another class’s awakeFromNib.

    I wrote a simple app that will reproduce this behavior. So what happens is that the modal dialog loads happily and when you close the modal window not only does it close but the app exits. I imagine that this is an “as designed” behavior. I was reading up in apple docs to see if I could understand why this was so but I am will muddled on it. I surmise that somehow my dialog’s modal event loop has hijacked the app’s event loop so that when the dialog ends so does the app.

    If anybody has a better understanding of this mistake please feel free to enlighten us…

    Thanks to all for reading and suggestions.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

There is apparently a bug in Android which breaks View.bringToFront . If I have
I managed to create a branch in git called '-f' e.g. $ git branch
I managed to create a class using CodeDom and add a single method to
I have managed to create a custom action in C# using MakeSfxCA which is
I've deconstructed a standard WPF button using Blend and have managed to create a
I've come across an issue where a web application has managed to create a
I am still very new to the MVC framework, but I managed to create
In EWS Managed API is it easy to create an appointment for a specific
I need to create a photo gallery service that is managed by users. I've
I want to create a List of KeyValuePair s in a managed C++ project.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.