On Feb 13, 2012, at 7:02 AM, Michael Crawford <[email protected]> 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 protected])
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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to [email protected]