On Thu, Mar 11, 2010 at 11:38 PM, Martin Hewitson <martin.hewit...@aei.mpg.de> wrote: > Thanks, Kyle. I figured the answer would be something like this. OK, then > I'll need to rethink the architecture a bit. I was aiming for an Xcode-like > interface with potentially multiple views to the same file content, but > without using 'updates continuously' this is going to be more difficult to > achieve. If anyone has any good suggestions, I'd be delighted to hear them.
Start by reading the text system documentation, and then re-reading it. :) Then try to build a simple app that has two windows looking at the same text storage, so that typing in one causes immediate corresponding changes in the other. That'll get you the base of what you need. As far as integrating with Core Data, you will certainly need custom logic to translate the NSTextStorage world into the KVC-based NSManagedObject world. Perhaps you should subclass NSTextStorage for use in your model objects, and have its special knowledge inform your NSManagedObject subclass of pertinent changes so it can update its serialized version of the text as appropriate. This gets you the updates continuously behavior you want but uses the framework correctly to do it. Again, it's not trivial, but certainly not impossible. Our apps certainly do it. --Kyle Sluder _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com