Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
_mainView = [[_window contentView] retain]; ... [_window release]; _window = nil; return _mainView;
我遇到了上面的代码片段,我想知道它真正产生了什么影响。谢谢。
现在,您是NSView窗口视图层次结构中可访问性最高的对象的所有者。
NSView
NSView *mainView = [[window1 contentView] retain]; [window1 release]; window1 = nil; [window setContentView:mainView];