Q:  How can you add text to the end of a text object?
	
A:  The trick is to make a zero length selection at the end of the text, and add the new text there.  The following code snippet illustrates the necessary steps:

/* This routine assumes that you have defined currentDocWindow somewhere else */ 

- addText:(const char *)newString
{
	int length;
	id  currentDocText;
	
	/* Get the current text document */
	currentDocText = [[currentDocWindow contentView]docView];
	length = [currentDocText textLength];
	[currentDocText setSel:length :length];
	[currentDocText replaceSel:newString];
	
	return self;
}

QA396

Valid for 1.0, 2.0, 3.0, 3.1