2010-05-02 5 views
1

j'ai un problème coupé texte de UITextView, je comprends comment idon't peut mettre en œuvre Cut, par exemple copier ou coller c'est comme ça:UITextView couper le problème! (IPhone sdk)

-(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]; 
    } 

mais de coupe! merci,

+0

une réponse? : -S –

Répondre

2

Vous pouvez faire cela, car une coupe est juste une copie et une suppression:

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

WOOW Bonne idée! Je vous remercie –

Questions connexes