Reputation: 41
_mainView = [[_window contentView] retain];
...
[_window release];
_window = nil;
return _mainView;
I meet code snippet above, I want to know what effects it really makes. Thx.
Upvotes: 1
Views: 385
Reputation: 22930
Now you are the owner of highest accessible NSView
object in the window’s view hierarchy.
NSView *mainView = [[window1 contentView] retain];
[window1 release];
window1 = nil;
[window setContentView:mainView];
Upvotes: 1