cocoa - Resizing views dynamically osx -


i have 2 views , button @ top, want 1 hidden/shown when button pressed , other views resize edge of window.

the button on top left links ibaction hides lower view mainscroll.hidden = true. can not figure out how resize/move other views textbox/button @ bottom of window, ie no visible gray space @ bottom. programmatically.

enter image description here http://imgur.com/a/fgh7i enter image description here

here how can adjust topview programmatically:

float aheight = [mainscroll frame].size.height; nsrect arect = [topview frame]; arect.size.height += aheight; arect.origin.y -= aheight; [topview setframe:arect];