Re: Noob question: Weirdness getting the bounds of an NSView...
Re: Noob question: Weirdness getting the bounds of an NSView...
- Subject: Re: Noob question: Weirdness getting the bounds of an NSView...
- From: Quincey Morris <email@hidden>
- Date: Tue, 24 Mar 2009 14:55:07 -0700
On Mar 24, 2009, at 10:46, Jim Anderson wrote:
The weird thing is, when drawRect gets called, [self bounds] returns a
reasonable looking bounding rectangle. When doSomeStuff gets
called, [self
bounds] returns {0, 0, 0.0, 0.0}. The extra weird thing is, if
doSomeStuff
is called *after* drawRect gets fired, myBounds is {0, 0, 0.0, 0.0},
*despite* it being set to something reasonable in drawRect.
Any ideas what's going on here?
The usual cause of this sort of thing is accidentally creating two
different view instances. If you put an instance of your custom
subview into your NIB file using Interface Builder, you should not
also create an instance of your view programmatically.
When you see the different values of myBounds in the two methods, are
the values of 'self' different? I'd guess they are.
_______________________________________________
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