0
我想插入文本光标所在目前,所以我有下面的代码插入字符串光标所在
NSString *contentsToAdd = [myData objectAtIndex:row];
NSMutableString *tfContent = [[NSMutableString alloc] initWithString:[self.myTextView text]];
// add content where the cursor was
[tfContent insertString:contentsToAdd atIndex:myCursorPosition.location];
[self.myTextView setText:tfContent];
[tfContent release];
This works as below
Hi
HiFriend
其实我想之前和附加文本后留下一个空间(喜的朋友)。
所以我该怎么去。 扶我起来,欢呼声