0

我有一个子类定义如下,

#import <Cocoa/Cocoa.h>

@interface ICMusicBrowserWindowController : NSWindowController
{

}

然后我创建上述子类的实例如下

ICMusicBrowserWindowController *musicBrowserWindowController = [[ICMusicBrowserWindowController alloc] initWithWindowNibName:@"Browser"];
[musicBrowserWindowController setDelegate:self];

我试着像这样要求windowmusicBrowserWindowController

[NSApp beginSheet:[musicBrowserWindowController window] 
   modalForWindow:[[self view] window]
    modalDelegate:self 
   didEndSelector:@selector(sheetDidEnd:returnCode:contextInfo:) 
      contextInfo:nil];

但是,这样做时,我收到警告消息,window maybe deprecated because receiver type is unknown.

关于我做错了什么的任何建议?我注意到这个警告信息只出现在 OSX Lion 中。谢谢。

4

1 回答 1

1

更新:我只是将我的 NSWindowController 子类的标题放入我正在使用 [instance window] 的类中并且警告消失了......(我还把我的 NSWindowController 子类的前向声明 @Class 放入标题中我在哪里使用它)其中一个或两个修复了警告......所以试试看。

所以我以前的答案是关闭的,我现在相信。

于 2011-10-22T18:36:01.373 回答