zoukankan      html  css  js  c++  java
  • UIActionSheet & UIAlertView

    UIActionSheet *actionSheet = [[UIActionSheet alloc] 
    											  initWithTitle:@"您是否真的要发邮件给他?"
    											  delegate:self 
    											  cancelButtonTitle:@"Cancel" 
    											  destructiveButtonTitle:@"Yes" 
    											  otherButtonTitles:nil];
    				
    				[actionSheet showInView:self.view];
    				[actionSheet release];
    
    - (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex
    {
    	if (buttonIndex == 0) 
    	{
    		SendMailViewController *detailViewController = [[SendMailViewController alloc] init];
    		detailViewController.emailAddress = [dict objectForKey: @"Email"];
    
    		[[self navigationController] pushViewController:detailViewController animated:YES];
    		[detailViewController release];	
    	}
    }
    
    NSString* webPage =  [dict objectForKey: @"WebPage"];
    				NSURL* url = nil;
    				
    				if ([webPage length] == 0 ) {
    					return;
    				}
    				
    				if( [webPage hasPrefix:@"http://"])
    				{
    					url = [NSURL URLWithString:webPage];
    				}
    				else {
    					NSString* fullWebPage = [NSString stringWithFormat:@"http://%@",webPage];
    					url = [NSURL URLWithString:fullWebPage];
    				}
    				
    				if ([[UIApplication sharedApplication] canOpenURL:url]) {
    					[[UIApplication sharedApplication] openURL:url];
    				}
    				else {
    					UIAlertView* alert = [[UIAlertView alloc] initWithTitle:@"Cannot open page"
    																	message:@"网址有误,或网络暂时不能访问" 
    																   delegate:nil 
    														  cancelButtonTitle:@"OK" 
    														  otherButtonTitles:nil];
    					[alert show];
    					[alert release];
    				}
    
  • 相关阅读:
    flash时间控制
    内联元素及其特性 &块元素
    清除浮动两种方法
    ie6 lineheight失效 待测试
    表单 文字和输入框对齐的最简单的方法
    ie6bugie6默认的最小高度是设定字体的高度
    CSS triangle generator
    解释性的语言vs编译性语言
    outerHeight(options)
    获取input的value值得 jQuery插件
  • 原文地址:https://www.cnblogs.com/season2009/p/2567542.html
Copyright © 2011-2022 走看看