On May 18, 2010, at 15:21, Richard Somers wrote:

> I have verified that the setter 'setFoo' is being called in all cases so that 
> is not the problem as I originally thought.
> 
> In 'awakeFromNib' when 'bindFoo' is called before 'setView' the layer frame 
> is set but never actually changes to the set value! So the problem is not one 
> of binding but of layer initialization.
> 
> The user default value of foo is 8 which means the first time through 
> 'setFoo' sets the layer frame width and height to 17. But the layer frame 
> width and height never actually get changed but are a value of 1 (not sure 
> where that comes from) which for me is a non-operational layer and causes 
> other problems.

It's a bit hard to tell, because there's too much getting tested at once here, 
but it looks like you have 2 possible problems:

1. Setting the frame on a layer that doesn't have a view yet doesn't do 
anything useful. This happens because the 'bind:...' invocation is going to 
cause the setter to be invoked initially, and in your non-working case, the 
view's layer hasn't been set yet.

and/or

2. The setter is getting called with a value of 0. That would set the width and 
height of the layer to 1.

There may a third thing going on too, but the other things are in the way.

You need to set a breakpoint in the setter and examine to backtrace (call 
stack) to figure out when and why it's being called, I think.


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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 arch...@mail-archive.com

Reply via email to