Search code examples
cocoaheightwidthautoresizingmask

autoresizingmask for height and width


Im using cocoa in xcode 4.4 and I have a window which contains a view loaded from an xib file. I have created another view inside it which i would like to resize to fill the outer view whenever i make the window fullscreen.

I have tried using:

[self setAutoresizingMask:NSViewWidthSizable];

And

[self setAutoresizingMask:NSViewHeightSizable];

And they work but obviously this only sizes the view in one direction. Is there a way of doing both?

Thanks in advance, Ben


Solution

  • [self setAutoresizingMask: (NSViewWidthSizable | NSViewHeightSizable)];