• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Problem assigning NSView bounds from subview.bounds
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Problem assigning NSView bounds from subview.bounds (From: Michael Crawford <email@hidden>)

  • Prev by Date: Re: Playing Music in Objective C
  • Next by Date: Re: Playing Music in Objective C
  • Previous by thread: Problem assigning NSView bounds from subview.bounds
  • Next by thread: Odd display of percent character
  • Index(es):
    • Date
    • Thread