Re: Problem assigning NSView bounds from subview.bounds
Re: Problem assigning NSView bounds from subview.bounds
- Subject: Re: Problem assigning NSView bounds from subview.bounds
- From: Kyle Sluder <email@hidden>
- Date: Mon, 13 Feb 2012 08:01:31 -0800
On Feb 13, 2012, at 7:02 AM, Michael Crawford <email@hidden> wrote:
> I'm trying to have a superview resize itself to match the bounds of a subview when the subview is added. When I do, the superview bounds become NaN.
>
> Why would this:
>
> - (void)didAddSubview:(NSView *)view
> {
> // resize to match bounds of given subview
> NSLog(@"%@ = %@, %@ = %@", self, NSStringFromRect([self bounds]), view, NSStringFromRect([view bounds]));
> [self setBounds:[view bounds]];
You want to call -setFrame:.
--Kyle Sluder
_______________________________________________
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