windowDidLoad

Discussion in 'Mac Programming' started by semaja2, Feb 17, 2007.

  1. macrumors 6502a

    Joined:
    Dec 12, 2005
    Location:
    Adelaide
    #1
    Hey,

    I seem to be having trouble, i need to call my application to the front when a menu item is called (due to the app being a NSMenuBar item)

    Im just using basic AS code in ObjC that activates the app, this works when im manually do it in script editor.

    However heres the problem, im unable to make the windowDidLoad method to be called, is there any one that can help me with detecting a window load or open
     
  2. macrumors G4

    Eraserhead

    Joined:
    Nov 3, 2005
    Location:
    UK
    #2
    The the windows delegate the controller with the method? Is the method in the header file? And have you tried reloading the controller in the nib?
     
  3. Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #3
    Ew ;)

    AppleScript should never be used in Cocoa unless you absolutely need it - and that is when you're communicating between applications, not doing system tasks.

    If you want to bring your app to the front, use:
    Code:
    [NSApp activateIgnoringOtherApps:YES];
    Regarding windowDidLoad, is your controller a NSWindowController subclass?
     
  4. thread starter macrumors 6502a

    Joined:
    Dec 12, 2005
    Location:
    Adelaide
    #4
    Heres a small example of my problem,

    Clicking on window1 will just call the window open using a normal connection (The way i do in my apps)

    Clicking on window2 will call the window by coding as well as make the app come to the front

    Clicking on about is the same as window1 but calling the standard about window

    PS. Once you open the app switch to like finder and use the menu item.
     

    Attached Files:

Share This Page