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

xamarin monomac.appkit.nsapplicationdelegate is defined in assembly that is not referenced

I'm trying to test some code from a tutorial on Xamarin, but I get this error: The type 'MonoMac.AppKit.NSApplicationDelegate' is defined in an assembly that is not referenced. But don't know where to look for the error. I include a photo so you…
Sascuash
  • 3,661
  • 10
  • 46
  • 65
0
votes
1 answer

How would I develop something like DeskLock from Deskshade?

Sorry to be a nuisance, but I have yet ANOTHER question. How would I do something like DeskLock from macrabbit's Deskshade app? I've made the little window and that's as far as I've come. I know how to "lock" the screen in 10.6 with…
0
votes
1 answer

iPhone applicationDidFinishLaunching called once in simulator

I put an NSLog statement inside my applicationDidFinishLaunching method. I build and run and see the log output. Then if I hit the home button (in the simulator) and restart the app, I don't see the log output. Why?
Ternary
  • 2,401
  • 3
  • 31
  • 54
0
votes
1 answer

-SendEvent does not behave as expected

I have a full-screen transparent window that displays above the main menu of my app. It has ignoresMouseEvents set to NO. To receive mouse clicks nonetheless, I added this code : [NSEvent addLocalMonitorForEventsMatchingMask:NSLeftMouseDownMask…
Fatso
  • 1,278
  • 16
  • 46
0
votes
1 answer

Notification When NSApplication receives 'miniaturizeAll' call

Is this possible, like when you call 'hide:' it calls 'applicationWillHide:'? My application uses a variable amount of windows, depending on the amount of available screens, so it doesn't miniaturize those NSWindow instances when 'miniaturizeAll:'…
Fatso
  • 1,278
  • 16
  • 46
0
votes
1 answer

applicationDidBecomeActive doesn't fire in OSX application

In my app i have the following setup : // .h @interface MyDocument : NSPersistentDocument { ... } // .m @implementation MyDocument -(void) applicationDidBecomeActive:(NSNotification *)notification { ... } The…
Eugene Gordin
  • 4,047
  • 3
  • 47
  • 80
0
votes
1 answer

NSApplication.SharedApplication.Terminate doesn't actually terminate my application after unhandled exception

I am developing a simple application for OSX with MonoMac. When my application experiences unhandled exceptions, I catch them with: AppDomain.CurrentDomain.UnhandledException += (sender, e) => Unhandled(e.ExceptionObject as Exception); Inside…
Erlend D.
  • 3,013
  • 6
  • 37
  • 59
0
votes
2 answers

webview with configurable URL

I am new to objective c programming and working with cocoa application. Here is my static URL webview based application. AppDelegate.h contains @interface AppDelegate : NSObject @property (assign) IBOutlet WebView…
sajid
  • 39
  • 7
0
votes
2 answers

One Cocoa app notified when another cocoa app terminated

Suppose there are two cocoa apps APP1 and APP2. I want APP2 to be notified when APP1 terminates. I want some callback function registered with APP2 which will be called as soon as APP1 terminates. How can I achieve this? Any sample code will be…
0
votes
1 answer

What is the best way to make another app active in Cocoa?

I have an app that generates key commands in another app. I used to do it in Applescript studio but I have rewritten in Obj-C. Now I can't figure out how to make the other active in the foreground so I can start generating key commands. Currently I…
Brian Slack
  • 13
  • 1
  • 5
0
votes
1 answer

Cocoa hide menubar without dock

is it possible to hide menubar without hidding dock in cocoa? like Launchpad do. I have tried [[NSApplication sharedApplication] setPresentationOptions:0x04]; but unfortunately this it doesn't work maybe there is some private API to do that?
Awesome
  • 153
  • 1
  • 1
  • 4
-1
votes
1 answer

Adding NSMenuItem to NSApp.MainMenu not inserting new menu item

I'm using the following code to add a new menu item programatically override func viewDidLoad() { let mainMenu = NSApp.mainMenu let myMenu = NSMenuItem(title: "MenuTitle", action: nil, keyEquivalent: "") mainMenu!.addItem(myMenu) } But…
techno
  • 6,100
  • 16
  • 86
  • 192
-2
votes
1 answer

Can [NSApplication sharedApplication] ever return nil?

In a MacOS app in Objective-C is it possible for [NSApplication sharedApplication] to return nil or is it a safe assumption that this will never return nil? The Documentation describes the behavior: Returns the application instance, creating it if…
user16217248
  • 3,119
  • 19
  • 19
  • 37
1 2 3
11
12