I am very new to Cocoa and I am developing one normal Cocoa desktop application in Xcode 4.5. I have a requirement to display values in NSComboBox
and I have to retrieve from NSComboBox
, but restriction is that I should not do bindings to IBOutlet
.
If we want we need any use of Array controllers we can use NSArrayController
s but not with IBOutlet
s.
Will any one suggest me how to perform this task without using IBOutlet
s.
I don't want to use IBOutlet
s because of:
It reduces the code: Assume we have 15 text fields in UI, so you need to have 15
IBOutlet
s (If you are working on small project you can have it but when we implement bigger size project, you may end up creating tons ofIBOutlet
s, which does nothing other then helping to access value from the text fields.If you use binding rather than
IBOutlet
, handling UI is easy, Let's assume you have one table with linked arrayController. When array is modified which you linked with array Controller, automatically changes will reflect in the tableView, you no need bother about updating the tabelView, if we useIBOutlet
, we have to scratch out head to update the content. Whenever data is modified which we display in tableView.Makes developer's life easy: If we use bindings, Any changes happened in binding object immediately reflects in the UI, we need not worry about updating of UI.
Easy-to-understand code: If we use
IBOutlet
s unnecessarily we end up with writing code to handle views, updating views and etc, in case we use bindings automatically it updates.
According to me. Good practice if we use bindings.
IBOutlet
s simply increase length of code.
Thank you in advance...