0
忽略TextField,因爲buttonIndex不起作用,所以我離開文本字段的語法。AlertView ButtonIndex不工作
-(IBAction)bm1:(id)sender {
UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"Set Bookmark" message:@"Type URL Here" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Ok", nil];
alert.alertViewStyle = UIAlertViewStylePlainTextInput;
[alert show];
[alert release];
}
- (void)alertView:(UIAlertView *)alertview clickedButtonAtIndex:(NSInteger)buttonIndex{
if (buttonIndex == 0) {
NSLog(@"It works");
}
}
工作謝謝! – 2012-08-14 01:47:38