objective c - Binding to NSComboBox -
i new cocoa , developing 1 normal cocoa desktop application in xcode 4.5. have requirement display values in nscombobox
, have retrieve nscombobox
, restriction should not bindings iboutlet
.
if want need use of array controllers can use nsarraycontroller
s not iboutlet
s.
will 1 suggest me how perform task without using iboutlet
s.
i don't want use iboutlet
s because of:
it reduces code: assume have 15 text fields in ui, need have 15
iboutlet
s (if working on small project can have when implement bigger size project, may end creating tons ofiboutlet
s, nothing other helping access value text fields.if use binding rather
iboutlet
, handling ui easy, let's assume have 1 table linked arraycontroller. when array modified linked array controller, automatically changes reflect in tableview, no need bother updating tabelview, if useiboutlet
, have scratch out head update content. whenever data modified display in tableview.makes developer's life easy: if use bindings, changes happened in binding object reflects in ui, need not worry updating of ui.
easy-to-understand code: if use
iboutlet
s unnecessarily end writing code handle views, updating views , etc, in case use bindings automatically updates.
according me. practice if use bindings.
iboutlet
s increase length of code.
thank in advance...
steps how bind:
draw nscombobox , nstextfield bind combo box.
in combo box add items interface builder.
select combo box. hold ctrl , drag nstextfield/label , select
takestringvaluefrom
.
that's it!!!
now can build & run , check selection changes in combo box visible in textfield well.
Comments
Post a Comment