
@H_502_8@
主窗口的代码是:@H_502_8@
@H_502_8@
#import "SeconDWindowController.h"@implementation FirstwindowController-(IBAction)showSeconDWindow:(ID)sender{ if (!seconDWindowController) seconDWindowController = [[SeconDWindowController alloc] init]; [[seconDWindowController window] makeKeyAndOrderFront:self];} SeconDWindowController是一个NSWindowController,如下所示:@H_502_8@
@H_502_8@
@implementation SeconDWindowController-(ID)init{ if (![super initWithWindowNibname:@"SeconDWindow"]) return nil; return self;} 我也尝试在makeKeyAndOrderFront之前放置[seconDWindowController showWindow:self],但它没有什么区别.@H_502_8@解决方法 您是否确保SeconDWindowController的窗口连接到NIB中的窗口?即使没有连接插座,也可以通过加载NIB来显示窗口. 总结
以上是内存溢出为你收集整理的cocoa – makeKeyAndOrderFront只执行后者全部内容,希望文章能够帮你解决cocoa – makeKeyAndOrderFront只执行后者所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)