views:

87

answers:

1

Hi , i have problem with cut some text from UITextView , i idon't understand how can implement Cut , for example copy or paste it's like this :

 -(IBAction)copy {

        NSString *copyString = [[NSString alloc] initWithFormat:@"%@",[textPad text]];
        UIPasteboard *pb = [UIPasteboard generalPasteboard];
        [pb setString:copyString];

    }

    -(IBAction)paste {
        UIPasteboard *pb = [UIPasteboard generalPasteboard];
        textPad.text = [pb string];
    }

but about cut ! thank you ,

+1  A: 

You can do this, since a cut is just a copy and a delete:

-(IBAction)cut {
  [self copy];
  textPad.text = @"";
}
Tony
WOOW Good idea ! thank you
Mc.Lover