Questions tagged [nsapplication]

NSApplication is the central class in Apple's AppKit framework.

The NSApplication class is the central class in Apple's AppKit framework (). It is responsible for starting the main run loop and provides the central framework for your application’s execution.

References:

178 questions
0
votes
1 answer

Performing an action when _statusItem is clicked, with a NSMenu and the window not in focus seems impossible

There are similar questions on SO but this have a twist. I need to trigger an action when the user clicks on my app icon sitting on the menu bar. The action is to bring its window to the front, or in other words, [[[NSApplication…
Duck
  • 34,902
  • 47
  • 248
  • 470
0
votes
1 answer

How to get process information in C++ Commandline app on Xcode

I'm writing a Commandline app on Xcode with C++ and am trying to replace the deprecated methods KillProcess(), GetNextProcess(), and CopyProcessName(). Documentation recommends using NSApplication-related methods but importing Foundation.h and…
Lenny
  • 388
  • 3
  • 15
0
votes
0 answers

Push Notification in objective-c when the App is Force Quit in Mac

How to push notifications when the user force quits the app or when the app is force killed from activity monitor?
0
votes
1 answer

Run actions before application terminates Swift Cocoa

I have several actions to perform before the application quits. They take about 3 or 4 seconds to be done (and may be more, up to 10 secs), and when I try to execute them in applicationWillTerminate, only a part of them are done. I also tried…
pomo_mondreganto
  • 2,028
  • 2
  • 28
  • 56
0
votes
1 answer

What are the correct connections for App Delegate and Application

Unannounced, the 2 notices in the image below were discovered while searching for why -applicationShouldTerminate: is not being called in AppDelegate.m on quit (Cmd+Q). It worked some time ago. Hovering over the two yellow triangles…
David
  • 3,285
  • 1
  • 37
  • 54
0
votes
1 answer

Could not connect the action buttonPressed: to target of class NSApplication when attempting to debug Mac OS X app on 10.7

I'm attempting to target 10.7 with my Mac OS X app, but when I try running it on a 10.7 machine no window opens and I get "Could not connect the action buttonPressed: to target of class NSApplication" logged to the console. When I try to build the…
davis
  • 1,911
  • 6
  • 26
  • 50
0
votes
1 answer

Getting a notification when other app's window move / resize

I'm creating a screen scraping application. What I'm trying now is to fit a rectangle around the corners of the active windows of a given application (by PID). I managed that by getting a reference to all the active windows in the workspace and…
StefanS
  • 1,089
  • 1
  • 11
  • 38
0
votes
1 answer

Check NSApp on Cocoa/OSX app has modal mode

How to check NSApp has modal mode? Stop modal window [NSApp stopModal]; But I don't see property check current app state is modal or not?
Huynh Inc
  • 2,010
  • 1
  • 25
  • 42
0
votes
1 answer

Why can setPresentationOptions and LSUIElement not be used together?

Code: [NSApp setPresentationOptions: NSApplicationPresentationHideMenuBar | NSApplicationPresentationHideDock]; It hides Dock and MenuBar OSX. When I add key LSUIElement into my Info.plist file and rerun my code: Dock is hidden, but MenuBar…
fhdnsYa
  • 443
  • 1
  • 6
  • 15
0
votes
1 answer

How to access OSX NSApplication from StoryBoard created default ViewController?

I’ve used Xcode 6.3 to create a very simple Swift Mac application. It is not a document-based app. My app has one NSViewController, and it loads, opens and runs as expected. However, now I need to use the Application menu, and I don’t see the…
Charlweed
  • 1,517
  • 2
  • 14
  • 22
0
votes
1 answer

Forcing the application to launch on the main monitor on a specific position

Because this app tracks the user using the computer camera, I need it to launch always on the main monitor, where the camera is (iMac/Macbook), on the horizontal center, on top of the screen. Like this: I know how to make it launch at the top and…
Duck
  • 34,902
  • 47
  • 248
  • 470
0
votes
2 answers

Window position is not restored when closing it by tapping x button?

I want to restore a window position of my Cocoa app whenever an user launches the app. This feature is implemented in default in Cocoa. However, I also want to make my app terminated by tapping the red x button on the top-left corner on the toolbar,…
Blaszard
  • 30,954
  • 51
  • 153
  • 233
0
votes
2 answers

Catching arguments for creating a new document with a document-based application on MAC

I am working on a document-based application for Mac. This application has its own data model and methods for writing and reading such kind of document. If I want to start this application with a predefined document I can do it in the following way:…
0
votes
1 answer

Cocoa NSApplication Threading Model

Hi I am a newbie to cocoa framework so needed help in understanding the framework better. My current focus area is to learn about the number of threads the NSApplication creates by default and methods to control it or limit it. i.e., I saw basic…
0
votes
2 answers

Cocoa: How to show a window un-modally?

I have un-checked the "Visible At Launch" option for the default window in MainMenu.xib file. But then, I could not find out how to show it programmatically... Do anyone know how to show this window, un-modally? Thank you at advance!
Andrew Chang
  • 1,289
  • 1
  • 18
  • 38
1 2 3
11
12