Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example doesn't work any more #5

Open
gradha opened this issue Mar 1, 2013 · 1 comment
Open

Example doesn't work any more #5

gradha opened this issue Mar 1, 2013 · 1 comment

Comments

@gradha
Copy link

gradha commented Mar 1, 2013

The provided example doesn't compile out of the box. After adding missing files to the project it still fails at runtime with:

2013-03-01 12:12:32.071 KVOBlockBindingExample[69343:11303] -[KVOBlockBindingViewController bind:keyPath:to:keyPath:addReverseBinding:]: unrecognized selector sent to instance 0x7564cd0
2013-03-01 12:12:32.078 KVOBlockBindingExample[69343:11303] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[KVOBlockBindingViewController bind:keyPath:to:keyPath:addReverseBinding:]: unrecognized selector sent to instance 0x7564cd0'
@mralexgray
Copy link

+1
it's because of the nonexistent methods...

-(void)twoWayBinding
{
    [self bind:stepper1 keyPath:@"value" to:stepper2 keyPath:@"value" addReverseBinding:YES];

    // add one way blocks to observe the stepper values
    [self observe:stepper1 keyPath:@"value" block:^(id observed, NSDictionary *change) {       
        stepper1Label.text = [NSString stringWithFormat:@"%1.0f",stepper1.value];
    }];
    [self observe:stepper2 keyPath:@"value" block:^(id observed, NSDictionary *change) {
        stepper2Label.text = [NSString stringWithFormat:@"%1.0f",stepper2.value];
    }];

}

etc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants