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

int3rc3pt0r

macrumors newbie
Original poster
Feb 9, 2010
9
0
Hey Guys check this code ( My Custom Keyboard) :
Code:
-(IBAction) updateTextBackSpace:(id)sender

{
    if([txtview.text length]>0)
    {
    NSString *deletedLastCharString = [txtview.text substringToIndex:([txtview.text length]-1)];
    [txtview setText:deletedLastCharString];
    }
    else
    {
        NSLog("End");
    }

I am able to erase the letters ( backspace ) but after the first letter is erased and if I press backspace one more time then the application crashes .. AND the main thing is that I can't figure out how to change this code so that , I can erase any text in any give line at the cursor, the backspace starts to erase from end of the line . Please Help
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.