-(void)alertControllerView:(NSString *)message
{
UIAlertController *alertController = [UIAlertController alertControllerWith :@"提示" message:message preferredStyle:(UIAlertControllerStyleAlert)];
[NSTimer scheduledTimerWithTimeInterval:1.0f
target:self
selector:@selector(timerFireMethod:)
userInfo:alertController
repeats:YES];
[self presentViewController:alertController animated:YES completion:nil];
}
- (void)timerFireMethod:(NSTimer*)theTimer//弹出框
{
UIAlertController * alertController = (UIAlertController*)[theTimer userInfo];
[alertController dismissViewControllerAnimated:YES completion:nil];
alertController = NULL;
}
//点击头像实现
1.
UIAlertController * alertController = [UIAlertController alertControllerWith : nil message: nil preferredStyle:UIAlertControllerStyleActionSheet];
2.
[alertController addAction: [UIAlertAction actionWith : @"拍照" style: UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
//拍照
}]];
[alertController addAction: [UIAlertAction actionWith : @"从相册选取" style: UIAlertActionStyleDefault handler:^(UIAlertAction *action){
//相册
}]];
[alertController addAction: [UIAlertAction actionWith : @"取消" style: UIAlertActionStyleCancel handler:nil]];
3.
[self presentViewController: alertController animated: YES completion: nil];