• 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: Programmatic Binding
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Programmatic Binding


  • Subject: Re: Programmatic Binding
  • From: Quincey Morris <email@hidden>
  • Date: Tue, 18 May 2010 15:44:58 -0700

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 (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

  • Follow-Ups:
    • Re: Programmatic Binding
      • From: Richard Somers <email@hidden>
References: 
 >Programmatic Binding (From: Richard Somers <email@hidden>)
 >Re: Programmatic Binding (From: Quincey Morris <email@hidden>)
 >Re: Programmatic Binding (From: Richard Somers <email@hidden>)
 >Re: Programmatic Binding (From: Quincey Morris <email@hidden>)
 >Re: Programmatic Binding (From: Richard Somers <email@hidden>)

  • Prev by Date: Re: singleton design pattern
  • Next by Date: Re: singleton design pattern
  • Previous by thread: Re: Programmatic Binding
  • Next by thread: Re: Programmatic Binding
  • Index(es):
    • Date
    • Thread