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

Programmatic Binding


  • Subject: Programmatic Binding
  • From: Richard Somers <email@hidden>
  • Date: Tue, 18 May 2010 08:17:07 -0600

I have an issue that has me absolutely stumped. I have a custom view using a custom layer. When 'bind:toObject:withKeyPath:options:' is called after 'setView' the binding works. When it is called before 'setView' the binding does not work.

// MyCustomView (this version works)
- (void)awakeFromNib
{
     layer = [[MyCustomLayer alloc] init];
     [layer setView:self];
     [layer bindFoo]; // bind works
     ...
}

// MyCustomView (this version does not work)
- (void)awakeFromNib
{
     layer = [[MyCustomLayer alloc] init];
     [layer bindFoo]; // bind does not work
     [layer setView:self];
     ...
}

// MyCustomOpenGLLayer
@property (retain) MyCustomView *view;
@synthesize view;

- (void)bindFoo
{
     [self bind:@"foo"
       toObject:[NSUserDefaultsController sharedUserDefaultsController]
    withKeyPath:@"values.foo"
        options:nil];
}

Any ideas why the first version works but not the second?

--Richard

_______________________________________________

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: Chaitanya Pandit <email@hidden>
    • Re: Programmatic Binding
      • From: Quincey Morris <email@hidden>
    • Re: Programmatic Binding
      • From: Richard Somers <email@hidden>
  • Prev by Date: Re: baseURL problem with +fileURLWithPath:
  • Next by Date: Re: Blog post announcements
  • Previous by thread: Re: baseURL problem with +fileURLWithPath:
  • Next by thread: Re: Programmatic Binding
  • Index(es):
    • Date
    • Thread