[Biococoa-dev] BCSequenceView

Koen van der Drift kvddrift at earthlink.net
Fri Feb 25 21:05:02 EST 2005


Hi,

I copied most of the code in BCSequenceView from an app that I develop 
(and which already uses part of BioCocoa). In my app the sequence is 
displayed with a whitespace every 10 characters. Without thinking I 
copied that code also to BCSequenceView (in the updateLayout method), 
and found that it is not working. It took some time to realize why, and 
that is that in my app, the view is coupled to a controller. The 
controller is notified by a textDidChange notification, and in turn 
sends it a message to the view to update the layout. Of course I can 
add that code to the controller in the demo app, but that would make 
BCSequenceView dependent on another object that is outside the 
framework.

So I added the textDidChange method directly to BCSequenceView, 
although this catually is a method for the delegate. Indeed the 
whitespaces are now added and updated when editing the text. The only 
problem now is that I cannot put the cursor in the middle of the text. 
New characters are only added to the end of the text.


Any ideas what might be going on and how to fix it without using a 
delegate object?


thanks,

- Koen.




More information about the Biococoa-dev mailing list