博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
IOS应用
阅读量:4678 次
发布时间:2019-06-09

本文共 1889 字,大约阅读时间需要 6 分钟。

下面是这个类的一些功能:

 

1.设置icon上的数字图标

 

    //设置主界面icon上的数字图标,在2.0中引进, 缺省为0

    [UIApplicationsharedApplication].applicationIconBadgeNumber = 4;

2.设置摇动手势的时候,是否支持redo,undo操作

 

    //摇动手势,是否支持redo undo操作。

   //3.0以后引进,缺省YES

    [UIApplicationsharedApplication].applicationSupportsShakeToEdit =YES;

 

3.判断程序运行状态

 

    //判断程序运行状态,在2.0以后引入

    /*

     UIApplicationStateActive,

     UIApplicationStateInactive,

     UIApplicationStateBackground

     */

   if([UIApplicationsharedApplication].applicationState ==UIApplicationStateInactive){

        NSLog(@"程序在运行状态");

    }

 

4.阻止屏幕变暗进入休眠状态

 

    //阻止屏幕变暗,慎重使用,缺省为no 2.0

    [UIApplicationsharedApplication].idleTimerDisabled =YES;

慎重使用本功能,因为非常耗电。

5.显示联网状态

 

    //显示联网标记 2.0

    [UIApplicationsharedApplication].networkActivityIndicatorVisible =YES;

 

6.在map上显示一个地址

   NSString* addressText =@"1 Infinite Loop, Cupertino, CA 95014";

   // URL encode the spaces

    addressText =  [addressTextstringByAddingPercentEscapesUsingEncoding:NSASCIIStringEncoding];

   NSString* urlText = [NSStringstringWithFormat:@"http://maps.google.com/maps?q=%@", addressText];

    

    [[UIApplicationsharedApplication]openURL:[NSURLURLWithString:urlText]];

 

7.发送电子邮件

   NSString *recipients =@"mailto:first@example.com?cc=second@example.com,third@example.com&subject=Hello from California!";

   NSString *body =@"&body=It is raining in sunny California!";

    

    NSString *email = [NSStringstringWithFormat:@"%@%@", recipients, body];

    email = [emailstringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];

    

    [[UIApplicationsharedApplication]openURL:[NSURLURLWithString:email]];

 

8.打电话到一个号码

 

   // Call Google 411

    [[UIApplicationsharedApplication]openURL:[NSURLURLWithString:@"tel://8004664411"]];

9.发送短信

    // Text to Google SMS

 

    [[UIApplicationsharedApplication]openURL:[NSURLURLWithString:@"sms://466453"]];

10.打开一个网址

 

   // Lanuch any iPhone developers fav site

    [[UIApplicationsharedApplication]openURL:[NSURLURLWithString:@"http://itunesconnect.apple.com"]];

 

转载于:https://www.cnblogs.com/wcLT/p/4659988.html

你可能感兴趣的文章
算法 binary search
查看>>
cocos2d_android 第一个游戏
查看>>
【python小练】0000
查看>>
改变EasyUI默认分页显示数目
查看>>
Maven开始
查看>>
在sublime中的markdown的简单使用整理
查看>>
简单反爬虫技术介绍
查看>>
UITableView详解
查看>>
HDU1671——前缀树的一点感触
查看>>
codves——5960 信使
查看>>
BigDecimal用法详解
查看>>
初识kafka
查看>>
记一次Linux服务器top命令us负载很高,但是找不到高负载进程,引起服务器频繁重启的错误,内核升级...
查看>>
CentOS6 配置网络yum源
查看>>
RabbitMQ 通信过程
查看>>
【转载】Xcode和模拟器的快捷键汇总
查看>>
IOS管理文件和目录
查看>>
13. Roman to Integer【leetcode】
查看>>
CodeForces999A-Mishka and Contest
查看>>
u-boot下载模式LCD显示图片修改方法(基于TQ2440)
查看>>