在iOS8以前,我们都习惯性用UIAlertView去做提示框,iOS8以后,苹果提倡使用UIAlertController取代UIAlertView。

#defineSYSTEM_VERSION[[UIDevicecurrentDevice].systemVersionfloatValue]




if(SYSTEM_VERSION>=8.0){UIAlertController*alertCtrl=[UIAlertControlleralertControllerWithTitle:@"赎回成功"message:nilpreferredStyle:UIAlertControllerStyleAlert];UIAlertAction*okAction=[UIAlertActionactionWithTitle:@"确定"style:UIAlertActionStyleDefaulthandler:^(UIAlertAction*action){[self.navigationControllerpopViewControllerAnimated:YES];}];[alertCtrladdAction:okAction];[selfpresentViewController:alertCtrlanimated:YEScompletion:nil];}else{//这个else一定要写,否则会导致在ios8一下的真机crashUIAlertView*alert=[[UIAlertViewalloc]initWithTitle:@"赎回成功"message:nildelegate:selfcancelButtonTitle:nilotherButtonTitles:@"确定",nil];alert.tag=998;[alertshow];}


#pragmamark-UIAlertViewDelegate-(void)alertView:(UIAlertView*)alertViewclickedButtonAtIndex:(NSInteger)buttonIndex{if(alertView.tag==998){[self.navigationControllerpopViewControllerAnimated:YES];}}