Unique copy/paste behavior based on tableview

"earl.deshazer" <[email protected]>
Newsgroups gmane.comp.macosx.devel
Message-ID <[email protected]>
I'm trying to get an elegant/standard solution to a scenario that I suspect is common. I could easily cobble a solution together, but I hate re-inventing the wheel.

Overall, I am developing CoreData document-based application. In the copy/paste CoreData examples that I have seen:

http://developer.apple.com/mac/library/documentation/cocoa/conceptual/NSPersistentDocumentTutorial/05_CopyAndPaste/copyAndPaste.html#//apple_ref/doc/uid/TP40002833-SW1
http://themikeswan.wordpress.com/2009/05/30/a-core-data-tutorial-part-2-polishing-the-basics/

the examples assume that a copy is only possible from the employeeTableController. The capability of duplicating a manager MO and/or an employe MO is ignored. I have a scenario, however, which would require the copy action to discern which tableView/MO was selected to determine which MO (and its associated data) to copy. The paste action would similarly need to be aware of what tableView was selected to determine the appropriate coarse of action.

My hammer approach would utilize the mousedown: for each tableView to populate variables that I would define inside of MyDocument that would then be used in the copy/paste methods. This would make the copy/paste methods generic. Is there another way to get the behavior I am looking for? Have I overlooked some basic NSWindow/NSView/NSResponder behavior/information.

Thanks in advance,

Will DeShazer
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.