Why use use IBOutlets instead of bindings?
Bindings in IB seem simpler.
What can IBOutlets do that bindings can’t do?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Bindings aren’t a replacement for outlets, they’re just another way of hooking certain aspects of a UI up. That said, there are a lot of things that bindings aren’t very effective for that, for example, implementing
NSTableViewDataSourcewould allow you to handle (and you’d hook up said data source using an outlet).Further, you’re not about to get relevant views for your controller to interact with via a binding, but you can hook them up with outlets. In a sense, outlets are how you organize your objects — they might not do much on their own, but they provide data that you otherwise would have to dig around needlessly to get (sifting through subviews for a view with a given tag wouldn’t be much fun and is really wasted effort given that you have outlets to simplify the whole process for you).
My main point though is that you shouldn’t think of bindings as a replacement for outlets — they’re not. Bindings can’t replace outlets and outlets can’t replace bindings. Bindings depend on outlets to an extent, so you couldn’t get rid of them if you wanted to. Outlets, on the other hand, are just there to say what goes where. So that
NSTextViewgoes in propertystatusFieldand thatNSTableViewgoes in propertymessagesTableView.So, again, outlets are organization, they aren’t just something you use instead of bindings.