开发者

UITextView cut problem ! (iPhone sdk)

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 genera开发者_如何转开发lPasteboard];
        [pb setString:copyString];

    }

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

but about cut ! thank you ,


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

-(IBAction)cut {
  [self copy];
  textPad.text = @"";
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜