<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><DIV><BLOCKQUOTE type="cite"><BLOCKQUOTE type="cite"> </BLOCKQUOTE><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">I don't think a textview should take of filtering, it should just display a string. The controller should take care of the filtering, which would be more an MVC approach.</DIV></BLOCKQUOTE><BR><BLOCKQUOTE type="cite"> <BLOCKQUOTE type="cite"><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">A solution in the context of what you had in mind would be to delegate the filtering to the controller in those methods that I override, which is easy to do and elegant.</DIV> </BLOCKQUOTE><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">That's indeed a more MVC approach, so I will look into that.</DIV></BLOCKQUOTE><DIV><BR class="khtml-block-placeholder"></DIV>That's the difference between providing something for extensive reuse and something that fulfils specific needs in my app ;-)</DIV><DIV>Usually, the latter evolves slowly to the first, with the pressure on slowly, that's why it's done that way yet, at least the "proper" idea is there ;-)<BR><BLOCKQUOTE type="cite"><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">BTW, I think you forgot to include the Color_Extension and String_Extension files. The latter I guess contains the filterDNABases method?</DIV></BLOCKQUOTE><DIV><BR class="khtml-block-placeholder"></DIV><DIV>The color you can replace to your liking, here's the relevant string method:</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>-(NSString *)filterDNABases</DIV><DIV>{</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN>int i;</DIV><DIV> NSMutableString* filteredstring = [NSMutableString stringWithCapacity: [self length]]; </DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN>NSString *upper = [self uppercaseString];</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN></DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN>for(i=0; i<[upper length]; i++){</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN></DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN>switch([upper characterAtIndex: i]){</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN>case 'A':</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN>[filteredstring appendString: @"A"];</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN>break;</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN>case 'C':</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN>[filteredstring appendString: @"C"];</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN>break;</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN>case 'G':</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN>[filteredstring appendString: @"G"];</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN>break;</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN>case 'T':</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN>[filteredstring appendString: @"T"];</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN>break;</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN>case 'U':</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN>[filteredstring appendString: @"T"];</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN>break;</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN></DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN>case 'W':</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN>[filteredstring appendString: @"N"];<SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN> </DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN>break;<SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN></DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN>case 'S':</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN>[filteredstring appendString: @"N"];<SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN> </DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN>break;</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN>case 'M':</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN>[filteredstring appendString: @"N"];<SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN> </DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN>break;<SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN></DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN>case 'K':</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN>[filteredstring appendString: @"N"];<SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN> </DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN>break;</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN>case 'R':</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN>[filteredstring appendString: @"N"];<SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN> </DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN>break;<SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN></DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN>case 'Y':</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN>[filteredstring appendString: @"N"];<SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN> </DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN>break;</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN></DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN>case 'H':</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN>[filteredstring appendString: @"N"];<SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN> </DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN>break;<SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN></DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN>case 'V':</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN>[filteredstring appendString: @"N"];<SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN> </DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN>break;</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN>case 'D':</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN>[filteredstring appendString: @"N"];<SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN> </DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN>break;<SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN></DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN>case 'B':</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN>[filteredstring appendString: @"N"];<SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN> </DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN>break;</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN></DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN>case 'N':</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN>[filteredstring appendString: @"N"];<SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN> </DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN>break;<SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN></DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN></DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN>default:</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN>break;</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre"> </SPAN>}</DIV><DIV> }</DIV><DIV> return filteredstring;</DIV><DIV>}</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Alex</DIV><DIV><BR class="khtml-block-placeholder"></DIV><BR><BLOCKQUOTE type="cite"><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">cheers,</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">- Koen</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">_______________________________________________</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Biococoa-dev mailing list</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><A href="mailto:Biococoa-dev@bioinformatics.org">Biococoa-dev@bioinformatics.org</A></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><A href="https://bioinformatics.org/mailman/listinfo/biococoa-dev">https://bioinformatics.org/mailman/listinfo/biococoa-dev</A></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV> </BLOCKQUOTE></DIV><BR><DIV> <SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">***********************************</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Mek (Alexander Griekspoor)</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "> <SPAN class="Apple-converted-space"> </SPAN><FONT class="Apple-style-span" size="5"><SPAN class="Apple-style-span" style="font-size: 18px;"><B style="font-size: 18px; font-weight: bold; "><SPAN class="Apple-style-span" style="font-size: 18px; font-weight: bold; "><SPAN class="Apple-style-span" style="font-size: 18px; font-weight: bold; ">Mek</SPAN></SPAN></B></SPAN></FONT><FONT class="Apple-style-span" color="#7F7F7F" size="5"><SPAN class="Apple-style-span" style="font-size: 18px;; color: rgb(127, 127, 127); "><B style="color: rgb(127, 127, 127); font-size: 18px; font-weight: bold; "><SPAN class="Apple-style-span" style="color: rgb(127, 127, 127); font-size: 18px; font-weight: bold; "><SPAN class="Apple-style-span" style="color: rgb(127, 127, 127); font-size: 18px; font-weight: bold; ">en</SPAN></SPAN></B></SPAN></FONT><FONT class="Apple-style-span" size="5"><SPAN class="Apple-style-span" style="font-size: 18px;"><B style="font-size: 18px; font-weight: bold; "><SPAN class="Apple-style-span" style="font-size: 18px; font-weight: bold; "><SPAN class="Apple-style-span" style="font-size: 18px; font-weight: bold; ">Tosj</SPAN></SPAN></B></SPAN></FONT><FONT class="Apple-style-span" color="#7E7E7E" size="5"><SPAN class="Apple-style-span" style="font-size: 18px;; color: rgb(126, 126, 126); "><B style="color: rgb(126, 126, 126); font-size: 18px; font-weight: bold; "><SPAN class="Apple-style-span" style="color: rgb(126, 126, 126); font-size: 18px; font-weight: bold; "><SPAN class="Apple-style-span" style="color: rgb(126, 126, 126); font-size: 18px; font-weight: bold; ">.</SPAN></SPAN></B></SPAN></FONT><FONT class="Apple-style-span" size="5"><SPAN class="Apple-style-span" style="font-size: 18px;"><B style="font-size: 18px; font-weight: bold; "><SPAN class="Apple-style-span" style="font-size: 18px; font-weight: bold; "><SPAN class="Apple-style-span" style="font-size: 18px; font-weight: bold; ">com</SPAN></SPAN></B></SPAN></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Web: <A href="http://www.mekentosj.com">http://www.mekentosj.com</A></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Mail: <A href="mailto:mek@mekentosj.com">mek@mekentosj.com</A></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">***********************************</DIV><BR class="Apple-interchange-newline"></SPAN></SPAN> </DIV><BR></BODY></HTML>