开发者

create sheet from another class

开发者 https://www.devze.com 2023-03-03 23:16 出处:网络
I am able to creat sheet using : [NSApp beginSheet:scorePanel modalForWindow:mainWindow modalDelegate:self didEndSelector: NULL contextInfo:nil];

I am able to creat sheet using :

[NSApp beginSheet:scorePanel modalForWindow:mainWindow modalDelegate:self didEndSelector: NULL contextInfo:nil];

I can create sheet when I call this command directly. But when I call the method holding this command from other class I am not able to open sheet getting error :

* Assertion failure in -[NSApplication _commonBeginModalSessionForWindow:relativeToWindow:modalDelegate:didEndSelector:contextInfo:], /So开发者_开发知识库urceCache/AppKit/AppKit-1038.35/AppKit.subproj/NSApplication.m:3100 2011-05-06 18:52:43.282 CoreAnimationWizard[5647:903] Modal session requires modal window


Most likely it is because the window is not hooked up to File's Owner. If the window isn't set you will get that behavior.


Add a new reference outlet to File Owner's window.

0

精彩评论

暂无评论...
验证码 换一张
取 消