Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

displaying a sheet with new document



I'm trying to display a sheet (to connect to a database) in a document
based application. I'm using code that looks like this:

[NSApp beginSheet:connectionPanel
modalForWindow:consoleWindow
modalDelegate:nil
didEndSelector:nil
contextInfo:nil
];

My problem lies in where to put it... If I put it in awakeFromNib or
windowControllerDidLoadNibaController then I end up getting an error:

2004-06-26 14:50:05.938 SnortMAC[1768] *** Assertion failure in
-[NSApplication
_commonBeginModalSessionForWindow:relativeToWindow:modalDelegate:didEndSelector:contextInfo:],
AppKit.subproj/NSApplication.m:2763
2004-06-26 14:50:05.963 SnortMAC[1768] Modal session requires modal window

The funny part is that it works... I just get the errors on the
console. If I put a button in the document window that runs the same
code, then it works w/out error, so I know that things are connected
right and built right in IB... where should I put the code for this so
it happens automatically?

Thanks,
Eric
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.




Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.