When i started a new project, there was no AppController.h or AppController.m so i made a new class and typed in the code in the two files as you had it. then when i went to the bindings inspector for the check box, i clicked on "Bind to:" but there was no option in the pop-up for AppController
@ayastona Ya the AppController is just a class I make that is a NSObject subclass, I said to make this and the object in the nib file in the early tutorials, if you see AppController you should know to do this. You are probably missing the AppController object in the nib file is my guess for why it's not showing up. Again, I showed how to do this in the first few tutorials.
Is it possible to do this lesson without bindings? That is can we use KVC and KVO programmatically, as you did with dog and hunger? Right now I can't see how you would use the -addObserver method with any object on the view provided by apple.
@1937GRUMPY I won't do one because it may as well be done using target action if that is the case. But in essence the controller class is the main piece. It observes and changes the values. It will observe the given key path, and whenever it gets notified of a change it will use KVC to change whatever value it needs to. You can also use NSObject's implementation of the NSKeyValueBindingCreation informal protocol which has bind:toObject:withKeyPath:options: to programmatically bind objects.
@AppleProgramming Thanks Lucas. I wasn't asking you to do one. I wanted to know if it was possible. And if it is then I would try to do it myself. I had already set up outlets and such but I couldn't see how slider could observe checkbox. My idea was [checkBox addObserver: slider....] but I was stumped as to which implementation file it would go it. Obviously, I need to do some thinking as how to use the controller class or the informal protocol you mentioned. Thanks again.
@1937GRUMPY It really is more complicated then doing it in Interface builder, if you want some tips though, Apple has great documentation on Cocoa Bindings, if you google that it will be the first option.
When i started a new project, there was no AppController.h or AppController.m so i made a new class and typed in the code in the two files as you had it. then when i went to the bindings inspector for the check box, i clicked on "Bind to:" but there was no option in the pop-up for AppController
ayastona 3 months ago in playlist Cocoa Tutorials
@ayastona Ya the AppController is just a class I make that is a NSObject subclass, I said to make this and the object in the nib file in the early tutorials, if you see AppController you should know to do this. You are probably missing the AppController object in the nib file is my guess for why it's not showing up. Again, I showed how to do this in the first few tutorials.
AppleProgramming 3 months ago
Hi, I'm using XCode Version 4.1 and I don't have the "Binding" Inspector. How do I find the binding inspector or how do I add it to this Xcode?
blisspr0ducti0ns 4 months ago
Is it possible to do this lesson without bindings? That is can we use KVC and KVO programmatically, as you did with dog and hunger? Right now I can't see how you would use the -addObserver method with any object on the view provided by apple.
1937GRUMPY 5 months ago
@1937GRUMPY I won't do one because it may as well be done using target action if that is the case. But in essence the controller class is the main piece. It observes and changes the values. It will observe the given key path, and whenever it gets notified of a change it will use KVC to change whatever value it needs to. You can also use NSObject's implementation of the NSKeyValueBindingCreation informal protocol which has bind:toObject:withKeyPath:options: to programmatically bind objects.
AppleProgramming 5 months ago
@AppleProgramming Thanks Lucas. I wasn't asking you to do one. I wanted to know if it was possible. And if it is then I would try to do it myself. I had already set up outlets and such but I couldn't see how slider could observe checkbox. My idea was [checkBox addObserver: slider....] but I was stumped as to which implementation file it would go it. Obviously, I need to do some thinking as how to use the controller class or the informal protocol you mentioned. Thanks again.
1937GRUMPY 5 months ago
@1937GRUMPY It really is more complicated then doing it in Interface builder, if you want some tips though, Apple has great documentation on Cocoa Bindings, if you google that it will be the first option.
AppleProgramming 5 months ago
This has been flagged as spam show
Good tutorial reminds me the observer pattern
soloafregar 5 months ago
Comment removed
soloafregar 5 months ago
Comment removed
soloafregar 5 months ago
First! yes nailed it!
anthropamorphic 5 months ago
@anthropamorphic Haha, hope the video quality improves, I lost my export settings from SL and I can't seem to get good settings with small file size.
AppleProgramming 5 months ago
@anthropamorphic lol
FredthaGr8t 5 months ago