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 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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to