Re: Maintaining an ordered array of attributes in an NSTextStorage subclass

2009-08-12 Thread Keith Blount
0/09, Alastair Houghton wrote: > From: Alastair Houghton > Subject: Re: Maintaining an ordered array of attributes in an NSTextStorage > subclass > To: "Keith Blount" > Cc: "Graham Cox" , cocoa-dev@lists.apple.com > Date: Monday, August 10, 2009, 9:22 PM

Re: Maintaining an ordered array of attributes in an NSTextStorage subclass

2009-08-10 Thread Alastair Houghton
On 10 Aug 2009, at 21:07, Keith Blount wrote: Many thanks again for the reply, much appreciated. - replaceCharactersInRange:withString:, -setAttributes:range: (and - addAttribute:value:range:, which also needs overriding) is in fact exactly where I'm trying to intercept things. The problem is

Re: Maintaining an ordered array of attributes in an NSTextStorage subclass

2009-08-10 Thread Keith Blount
Many thanks again for the reply, much appreciated. -replaceCharactersInRange:withString:, -setAttributes:range: (and -addAttribute:value:range:, which also needs overriding) is in fact exactly where I'm trying to intercept things. The problem is _how_ best to maintain and keep up to date the a

Re: Maintaining an ordered array of attributes in an NSTextStorage subclass

2009-08-10 Thread Graham Cox
On 10/08/2009, at 11:21 PM, Keith Blount wrote: Thanks for the reply. I guess I lost the point in my long, rambling e-mail, so sorry about that. What I really meant to ask is *how* to maintain this list accurately. Given that the attribute can be added, removed, text can be copied and past

Re: Maintaining an ordered array of attributes in an NSTextStorage subclass

2009-08-10 Thread Keith Blount
associated with it might be cut in half and so on, what is the best approach for keeping this list updated as the text changes? Thanks again and all the best, Keith --- On Mon, 8/10/09, Graham Cox wrote: > From: Graham Cox > Subject: Re: Maintaining an ordered array of attributes

Re: Maintaining an ordered array of attributes in an NSTextStorage subclass

2009-08-10 Thread Graham Cox
On 10/08/2009, at 10:55 PM, Keith Blount wrote: does anyone have any better ideas as to how I might approach this? Don't know if "better", but why not just maintain the list you need yourself? You could either subclass NSTextStorage and add a comment array, or make another object that co

Maintaining an ordered array of attributes in an NSTextStorage subclass

2009-08-10 Thread Keith Blount
Hello, I'm trying to implement comments in an NSTextStorage subclass. The implementation of comments themselves is pretty simple: - I have a KBCommentsAttributeName custom attribute that gets assigned to ranges of text in my controller using the -addAttribute:value:range: methods. - This attri