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
其實我想之前和附加文本後留下一個空間(喜的朋友)。
所以我該怎麼去。 扶我起來,歡呼聲