Resolved Opening New Window From The Same nib...

Discussion in 'Mac Programming' started by KieferThomas, May 20, 2012.

  1. KieferThomas, May 20, 2012
    Last edited: May 21, 2012

    KieferThomas macrumors newbie

    Mar 27, 2012
    Hello All,

    I have been working with Xcode for a few weeks now and am finding it fun to work with.

    I have a problem which I have not figured out how to resolve. I have been searching the net and not coming up with any answers to this specifi problem...

    I have created a small project which I have created and I am calling a new window from within the same nib. This works fine once and only once when I call the new window from my menu. After I close the window and wish to re-open it the program crashes at the program initialization line in the main.m file with the error of: Thread 1: EXC_BAD_ACCESS(code=13, address=0x0).

    #import <Cocoa/Cocoa.h>

    int main(int argc, char *argv[])
    return NSApplicationMain(argc, (const char **)argv); <--- Error thrown after window closed...:eek:

    The above in the debug window of Xcode is showing argc = int(3) and arv = char '/'

    Can anyone give me some pointers how to straighten this out so I can call the new window from within the same nib? And not have this error...

    Thanks inadvance,

  2. KieferThomas thread starter macrumors newbie

    Mar 27, 2012
    Add New WindowController

    After adding a new object controller and changing it to a NSWindowController and making the proper links the program is working proplerly...

Share This Page