Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

andyiapan

macrumors newbie
Original poster
Feb 28, 2010
29
0
i design a button to give textview a newline~

Code:
inputfield.text =   [inputfield.text stringByAppendingString:@"\n"];
if i want to design a backspace UIbutton~

Code:
inputfield.text =   [inputfield.text stringByAppendingString:@"\b"];
i can't get backspace from this kind of code.

how can i input a backspace from pressing a UIbutton~~

many thanks~
 
Last edited by a moderator:

ianray

macrumors 6502
Jun 22, 2010
452
0
@
Code:
\b
...is a C escape code which corresponds to ASCII character 8.

When used in a terminal (VT52 example) this particular code moves the cursor backwards. But, as you have noticed, that will not work in other environments -- including text fields.

A better solution is to simply remove the last character from inputfield.text.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.