UIAlertView 类用法汇总

 1)简单的显示一个 alert:

UIAlertView *baseAlert = [[UIAlertView alloc] initWithTitle:@"Alert" message:@"" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"OK", nil]; 

[baseAlert show];

2) 多行按钮 

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath

{

    NSUInteger row = [indexPath row]; 

    NSString *rowValue = [listData objectAtIndex:row];

    NSString *message = [[NSString alloc] initWithFormat:@"You select %@", rowValue];

     UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Row selected!" message:message delegate:nil cancelButtonTitle:@"Yes, I Did" otherButtonTitles:nil];

     [alert show];

     [message release];

    [alert release];

    [tableView deselectRowAtIndexPath:indexPath animated:YES];

}

//后续还将继续补充

 

 

本文出自 “Record” 博客,请务必保留此出处http://mjrao.blog.51cto.com/6086668/1007884

你可能感兴趣的:(uialertview)