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 6593135
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T17:38:36+00:00 2026-05-25T17:38:36+00:00

I’m trying to create a Cocoa app that needs to target Mac OS X

  • 0

I’m trying to create a Cocoa app that needs to target Mac OS X 10.5. I create a new Cocoa app and it auto-generates the first form for me.

If I build, it’ll work well, until I change my base SDK to 10.5, at which point the build fails with a “Cannot find protocol declaration for NSApplicationDelegate.”

Now, I know that NSApplicationDelegate was a 10.6 feature. I’ve searched and found others who simply say to remove the NSApplicationDelegate protocol. I do that and it will build and run, but I can’t get the app to exit. If I click the red button to close the window, it closes but the dock icon remains.

I suspect it has something to do with the form not getting/handling the exit event; however, I’m new at Xcode so I’m not sure what the window code should look like and finding sample source for 10.5 has proven tricky.

Can anyone help me? Thanks in advance.

  • 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-25T17:38:37+00:00Added an answer on May 25, 2026 at 5:38 pm

    Now, I know that NSApplicationDelegate was a 10.6 feature. I’ve searched and found others who simply say to remove the NSApplicationDelegate protocol. I do that and it will build and run, but I can’t get the app to exit. If I click the red button to close the window, it closes but the dock icon remains.

    That isn’t related to whether you declare conformance to that protocol (which doesn’t exist as a formal protocol in SDKs older than 10.6, which is why you couldn’t use it).

    On the Mac, windows and applications are two different things, so closing a window and quitting an application are likewise two different things. Applications own windows, so quitting an application will close all of its windows (but, if the app supports Lion’s state-restoration feature, they will come back when the application is next launched). Closing a window does not quit the application.

    However, for a single-window application, it does make sense for closing the application’s primary window to quit the application. System Preferences and numerous other single-window apps demonstrate this.

    To do that, implement a method from the NSApplication delegate protocol.

    Notice the way I wrote that. The protocol isn’t a formal protocol before 10.6, but it does still exist—as an informal protocol. You can’t declare conformance to it, but you can still implement its methods, and NSApplication will still send its delegate delegate messages.

    You need your application’s delegate to respond to applicationShouldTerminateAfterLastWindowClosed: by returning YES.

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

Sidebar

Related Questions

We're building an app, our first using Rails 3, and we're having to build
I'm trying to create an if statement in PHP that prevents a single post
Basically, what I'm trying to create is a page of div tags, each has
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I am trying to understand how to use SyndicationItem to display feed which is
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into

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.