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 nsarraycontrollers not iboutlets.

will 1 suggest me how perform task without using iboutlets.

i don't want use iboutlets because of:

  1. it reduces code: assume have 15 text fields in ui, need have 15 iboutlets (if working on small project can have when implement bigger size project, may end creating tons of iboutlets, 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 use iboutlet, have scratch out head update content. whenever data modified display in tableview.

  2. makes developer's life easy: if use bindings, changes happened in binding object reflects in ui, need not worry updating of ui.

  3. easy-to-understand code: if use iboutlets unnecessarily end writing code handle views, updating views , etc, in case use bindings automatically updates.

according me. practice if use bindings.

iboutlets increase length of code.

thank in advance...

steps how bind:

  1. draw nscombobox , nstextfield bind combo box.

  2. in combo box add items interface builder.

  3. 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

Popular posts from this blog

ruby - Trying to change last to "x"s to 23 -

jquery - Clone last and append item to closest class -

c - Unrecognised emulation mode: elf_i386 on MinGW32 -