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

  • SEARCH
  • Home
  • 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 6739509
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:29:51+00:00 2026-05-26T11:29:51+00:00

In my subclass of NSWindowController, [self window] is null. In my nib file THERE

  • 0

In my subclass of NSWindowController, [self window] is null.

In my nib file THERE IS a link between the File’s Owner (my subclass) and the Window View.

Why do I get this error ?

It stopped to work when I refactored the File Owner’s class (the subclass of NSWindowController). I’ve updated it in the nib so I don’t understand why it stopped to work.

Crashing line:

session = [NSApp beginModalSessionForWindow:[self window]];



   2011-10-25 12:27:14.377 MyApp [13161:b0f] *** Assertion failure in -[CBApplication _commonBeginModalSessionForWindow:relativeToWindow:modalDelegate:didEndSelector:contextInfo:], /SourceCache/AppKit/AppKit-1138.23/AppKit.subproj/NSApplication.m:3861
    2011-10-25 12:27:14.377 MyApp[13161:b0f] An uncaught exception was raised
    2011-10-25 12:27:14.378 MyApp[13161:b0f] Modal session requires modal window
    2011-10-25 12:27:14.380 MyApp[13161:b0f] (
        0   CoreFoundation                      0x92e01d87 __raiseError + 231
        1   libobjc.A.dylib                     0x9317e149 objc_exception_throw + 155
        2   CoreFoundation                      0x92d69619 +[NSException raise:format:arguments:] + 137
        3   Foundation                          0x9c41c36f -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 116
        4   AppKit                              0x958a987d -[NSApplication _commonBeginModalSessionForWindow:relativeToWindow:modalDelegate:didEndSelector:contextInfo:] + 725
        5   AppKit                              0x958a1973 -[NSApplication beginModalSessionForWindow:] + 72
        6   MyApp                     0x00042ca3 -[CBWindowController showModal:] + 131
        7   MyApp                     0x00023c46 -[CBDocument showLinkWindow:shouldLinkAndUpdate:selectedOnly:] + 1174
        8   MyApp                     0x00023cb1 -[CBDocument linkAllRootItems:] + 81
        9   MyApp                     0x0002a9b4 -[CBApplicationDelegate linkAllItems:] + 100
        10  CoreFoundation                      0x92d57091 -[NSObject performSelector:withObject:] + 65
        11  AppKit                              0x956e1cb3 -[NSApplication sendAction:to:from:] + 232
        12  AppKit                              0x957d5caf -[NSMenuItem _corePerformAction] + 536
        13  AppKit                              0x957d592c -[NSCarbonMenuImpl performActionWithHighlightingForItemAtIndex:] + 171
        14  AppKit                              0x957d4fb5 -[NSMenu _performActionWithHighlightingForItemAtIndex:sendAccessibilityNotification:] + 79
        15  AppKit                              0x95aaddab -[NSMenu performActionForItemAtIndex:] + 65
        16  AppKit                              0x95aaddde -[NSMenu _internalPerformActionForItemAtIndex:] + 45
        17  AppKit                              0x95ab200f -[NSMenuItem _internalPerformActionThroughMenuIfPossible] + 106
        18  AppKit                              0x9591ba10 -[NSCarbonMenuImpl _carbonCommandProcessEvent:handlerCallRef:] + 172
        19  AppKit                              0x9574a916 NSSLMMenuEventHandler + 452
        20  HIToolbox                           0x9b175920 _Z22_InvokeEventHandlerUPPP25OpaqueEventHandlerCallRefP14OpaqueEventRefPvPFlS0_S2_S3_E + 36
        21  HIToolbox                           0x9aff1803 _ZL23DispatchEventToHandlersP14EventTargetRecP14OpaqueEventRefP14HandlerCallRec + 1602
        22  HIToolbox                           0x9aff0c80 _ZL30SendEventToEventTargetInternalP14OpaqueEventRefP20OpaqueEventTargetRefP14HandlerCallRec + 482
        23  HIToolbox                           0x9b005aa9 SendEventToEventTarget + 76
        24  HIToolbox                           0x9b175de4 _ZL18SendHICommandEventmPK9HICommandmmhPKvP20OpaqueEventTargetRefS5_PP14OpaqueEventRef + 482
        25  HIToolbox                           0x9b175e4e SendMenuCommandWithContextAndModifiers + 70
        26  HIToolbox                           0x9b1e0697 SendMenuItemSelectedEvent + 275
        27  HIToolbox                           0x9b0423f9 _ZL19FinishMenuSelectionP13SelectionDataP10MenuResultS2_ + 129
        28  HIToolbox                           0x9b1d1574 _ZL14MenuSelectCoreP8MenuData5PointdmPP13OpaqueMenuRefPt + 608
        29  HIToolbox                           0x9b03a0b2 _HandleMenuSelection2 + 636
        30  HIToolbox                           0x9b039e31 _HandleMenuSelection + 53
        31  AppKit                              0x95646356 _NSHandleCarbonMenuEvent + 302
        32  AppKit                              0x955d662e _DPSNextEvent + 2196
        33  AppKit                              0x955d58ab -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 113
        34  AppKit                              0x955d1c22 -[NSApplication run] + 911
        35  AppKit                              0x9586618a NSApplicationMain + 1054
        36  MyApp                     0x000042f4 main + 36
        37  MyApp                     0x00002e06 start + 54

How the NSWindowController is created:

    CBWindowController *windowController = [[subClass alloc] init];
[windowController setRanAsModal:YES];
[windowController setDelegate:self];
[windowController setRootDocument:[NSApp mainWindowDocument]];
[windowController loadWindow];
[windowController centerOnMainWindow:sender];
  • 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-26T11:29:52+00:00Added an answer on May 26, 2026 at 11:29 am

    [self window] must point to a valid window object. From your comments, it is not.

    You must check and re-connect the window outlet, or, if there is no such outlet, ensure that a valid object is held in that variable.

    Automatic refactoring doesn’t appear to catch everything – so a search of your project for the old name would seem to be a worthwhile exercise after refactoring to prevent issues like this in the future.

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

Sidebar

Related Questions

I have a custom NSWindowController subclass that loads a NIB file during initialization like
I have a subclass of a view controller. After adding the view of this
I have a simple Cocoa app using a NSWindowController subclass. In the nib I
I have a subclass of NSWindowController that has its own nib and another class
I have a view subclass that starts from activity subclass like that: this.setContentView(instanceOfMyView); In
I have an NSWindowController subclass called _PreferencesWindowController with the following implementation - @synthesize window;
I have a UIView subclass that I'd like to instantiate from a NIB file.
I have a subclass of UIScrollView that I have set as the view of
Here is the UIPanGesture subclass: - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { NSLog(@touches began); self
Is it possible to subclass dynamically? I know there's ____bases____ but I don't want

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.