cocoa - Model Key Path With Multiple Properties -


here, i'm using nsarraycontroller bind properties core data entities value of text view table cells.

enter image description here

what syntax use access multiple properties of entity in model key path?

example format string: @"%@, %@", lastname, firstname;

in bindings inspector text field:

  1. select "value pattern: display pattern value1"
  2. bind array controller
  3. controller key = selection
  4. model key path = lastname
  5. display pattern = %{value1}@, %{value2}@
  6. select available in bindings inspector: "display pattern value2"
  7. bind value2 ac, selection, firstname

this documented in nstextfield section of cocoa bindings reference.

for completeness, here of own code sort of binding programmatically:

nsstring* bannerpattern = @": %{value1}@ items found, %{value2}@ hidden %{value3}@"; nsstring* totalpattern = [datestring stringbyappendingstring:bannerpattern];  [ftview.textfield bind:@"displaypatternvalue1" toobject:ft withkeypath:@"visiblenumber" options:@{nsdisplaypatternbindingoption : totalpattern}]; [ftview.textfield bind:@"displaypatternvalue2" toobject:ft withkeypath:@"hiddennumber" options:@{nsdisplaypatternbindingoption : totalpattern}]; [ftview.textfield bind:@"displaypatternvalue3" toobject:ft withkeypath:@"newstring" options:@{nsdisplaypatternbindingoption : totalpattern}]; 

Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -