• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
When do bound objects get updated?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

When do bound objects get updated?


  • Subject: When do bound objects get updated?
  • From: Darren Ford <email@hidden>
  • Date: Fri, 16 Jul 2004 18:11:39 +1000

Heya all,

I've been experimenting with Cocoa Bindings, and I'm running into a small problem that I can't get my head around. I have an NSTableView containing entries, which when I click an entry displays the entry data in an editable NSTextView. All of this works with bindings.

When I save the entries to a file (using NSArchiver), any changes that I've made to the current NSTextView contents don't get written to the file. What I'm assuming is happening is that when I click on an entry in the table, the data for the entry is copied to the NSTextView through the controller. Any editing that occurs is happening within the NSTextView store (so the original data in the entry is not dynamically changed). Therefore, if I try to archive the entry array, the currently edited data within the NSTextView won't get written, as it hasn't been 'pushed' back to the entry array.

If I change the selection in the table before saving, the data from the NSTextView's contents are pushed back to the entry array, thus updating the entries data and everyone is happy.

Basically, when the user selects 'Save' from the File Menu, I want to force the NSTextView to push it's data back to the array.

Does this make any sense? Or have I got things completely around the wrong way?

Thanks for any help.

Cheers -- Darren.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: When do bound objects get updated?
      • From: Larry Fransson <email@hidden>
  • Prev by Date: Getting progress of WebView load
  • Next by Date: Re: Changing Cell Size in at TableView?
  • Previous by thread: Re: Getting progress of WebView load
  • Next by thread: Re: When do bound objects get updated?
  • Index(es):
    • Date
    • Thread