Depending on how well you can map your code to the built-in Cocoa text-editing classes, this could be as easy as adding two NSLayoutManagers (each directing one NSTextContainer and NSTextView) beneath a single NSTextStorage instance. Apple even uses this configuration for one of their examples:
http://developer.apple.com/library/mac/#documentation/cocoa/...
The built-in notifications and delegate-relationships handle everything else (updates & synchronization) automatically. This is actually NeXTSTEP-level stuff that's been around for decades.
The built-in notifications and delegate-relationships handle everything else (updates & synchronization) automatically. This is actually NeXTSTEP-level stuff that's been around for decades.