Re: layout method not getting called on Content View
Re: layout method not getting called on Content View
- Subject: Re: layout method not getting called on Content View
- From: Quincey Morris <email@hidden>
- Date: Thu, 16 Apr 2015 19:42:34 +0000
On Apr 16, 2015, at 12:21 , Dave <email@hidden> wrote:
>
> On iOS, there is a method called “layoutSubviews” that I’ve used to do this sort of thing in the past, so it was deemed the correct place to do this in iOS, I assumed it would be the same or similar for Mac.
No, it’s “old school” on the Mac.
> I’m not sure where in the process to set the Frame, because if I do it just after the NIB is loaded it doesn’t seem to have any effect.
If you’re talking about a window NIB, then you have to defer rearrangement of the window contents until the window loading process is fully complete. The easiest way is to set the subview frames in your window controller’s ‘windowDidLoad’ override.
After that, you should be able to set the subview frames at any time.
There are earlier possible points of intervention, but it’s tricky because you have to be certain that the outlets you’re using to get references to the subviews have be set up, and that nothing else is going to intervene and undo what you did. ‘windowDidLoad’ is the One, True™ ending point of the loading process, though, so it’s not worth making things any harder than that.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden