我想覆盖子类NSWindow上的initWithContentRect,就像我在Obj-C中看到的那样,为了从笔尖创建一个无边框窗口。
如果我试试这个:
class GroupWindow < NSWindow
def initWithContentRect(contentRect, styleMask:windowStyle, backing:bufferingType, defer:deferCreation)
super.initWithContentRect(
contentRect,
styleMask:NSBorderlessWindowMask,
backing:bufferiMacngType,
defer:deferCreation)
end
end
然后以EXC_BAD_ACCESS
终止如果我试试这个:
def initWithContentRect(contentRect, styleMask:windowStyle, backing:bufferingType, defer:deferCreation)
super(
contentRect,
styleMask:NSBorderlessWindowMask,
backing:bufferingType,
defer:deferCreation)
end
然后只退出返回码1。
答案 0 :(得分:3)
你应该这样做:
super(contentRect,NSBorderlessWindowMask,bufferingType,deferCreation)