zoukankan      html  css  js  c++  java
  • tel

    //
    //  JZLTel.m
    //  JZLIntegrationDemo
    //
    //  Created by 微指 on 15/3/16.
    //  Copyright (c) 2015年 JZL. All rights reserved.
    //

    #import "JZLTel.h"

    @implementation JZLTel

    /*

    #pragma mark - 打电话
    -(void)callButtonAction
    {
        
        NSString * phone1 = [self.phones objectAtIndex:0];
        NSString * phone2 = [self.phones objectAtIndex:1];
        NSString * name = self.shopname;
        NSMutableSet * phones = [NSMutableSet set];
        
        if (![phone1 isEqualToString:@""] && phone1) {
            
            [phones addObject:phone1];
        }
        
        if (![phone2 isEqualToString:@""] && phone2) {
            
            [phones addObject:phone2];
        }
        
        NSArray * phonesArray = [phones allObjects];
        if (phonesArray.count>1) {
            
            UIAlertView * alert = [[UIAlertView alloc] initWithTitle:@"呼叫"
                                                             message:name
                                                            delegate:self
                                                   cancelButtonTitle:@"取消"
                                                   otherButtonTitles:nil];
            
            alert.tag = 500;
            
            for (int i=0; i<phonesArray.count; i++) {
                
                [alert addButtonWithTitle:[phonesArray objectAtIndex:i]];
            }
            [alert show];
            [alert release];
            
        } else if (phonesArray.count == 1) {
            
            UIWebView *callWebView = [[UIWebView alloc] init];
            NSURL *telURL = [NSURL URLWithString:[NSString stringWithFormat:@"tel:%@",[phonesArray objectAtIndex:0]]];
            [callWebView loadRequest:[NSURLRequest requestWithURL:telURL]];
            [self.view addSubview:callWebView];
            [callWebView release];
        }
        
    }

    -(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
    {
        if (buttonIndex != 0) {
            
            NSString * title = [alertView buttonTitleAtIndex:buttonIndex];
            NSString * str = [NSString stringWithFormat:@"tel:%@",title];
            [[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]];
        }
    }
     */

    @end

  • 相关阅读:
    S3C2440的LCD虚拟显示测试
    arm-linux-gcc编译器测试
    韦东山教程ARM的时钟设置出现的问题及其解决方法
    程序在nor flash中真的可以运行吗?
    存储器的速度
    程序测试的方法
    对编程的一些思考

    [算法题] 字节流解析
    [C/C++]函数指针和函数分发表
  • 原文地址:https://www.cnblogs.com/jzlblog/p/4342497.html
Copyright © 2011-2022 走看看