- 浏览: 908115 次
- 性别:
- 来自: 上海
文章分类
- 全部博客 (466)
- iPhone, iOS , Objective-c (155)
- 数据库 (20)
- 设计模式 (5)
- 第三方包管理,cocoapod (2)
- 版本管理, SVN, Subversion, Git (1)
- Google, Android, Java (14)
- Wordpress (1)
- 职业素养 (3)
- 版本管理,git (3)
- 前端小技巧 (2)
- flash (1)
- javascript (5)
- Ruby (0)
- 编程语言 (1)
- 网络常识 (1)
- 找到生活好感觉 (5)
- 产品经理 (1)
- markdown (1)
- 云服务器 (1)
- iPhone (116)
- iOS (116)
- Objective-c (116)
- 学习技巧 (2)
- Google (5)
- Android (6)
- Java (21)
- python (1)
- sqlite (3)
- node.js (2)
- mongodb (2)
- 学习技巧,阅读 (2)
- 软件测试 (3)
- 架构设计 (2)
- 设计 (1)
- Spring framework (3)
- junit (1)
- Linux (2)
- 软件 (1)
- Struts2 (1)
- 版本管理 (3)
- SVN (3)
- Subversion (3)
- Git (3)
- mysql (5)
- quartz (1)
- 无关技术 (1)
- 前端 (1)
- Redis (1)
- 产品管理 (0)
- 计算机常识 (1)
- 计算机科学 (0)
- swift (1)
- 服务器 (2)
- 搜索 (1)
- Scala (1)
- J2EE (1)
- maven (1)
- 前端css (1)
- 英语 (1)
- 消息队列 (1)
- kafka (0)
- apache kafka (4)
- netbeans (1)
- IDE (2)
- 歌词 (1)
- 过滤器实现 (1)
- linux vim vi (1)
- jmeter (1)
- springcloud (1)
最新评论
-
hujingnemo:
不知道为什么打不开
CHM如何改编字体大小 -
weiboyuan:
求答案 weiboyuanios@163.com
iOS软件工程师面试题(高级) -
xueji5368:
这个现在已经广泛使用了嘛!
RoboGuice入门 -
Yao__Shun__Yu:
...
CHM如何改编字体大小 -
353144886:
非常之详细 美女求认识
sqlite数据类型 datetime处理
先介绍一种最简单的方法:
调用打电话功能
[[UIApplicationsharedApplication] openURL:[NSURL URLWithString:@"tel://10086"]];
调用发短信功能
[[UIApplication sharedApplication]openURL:[NSURL URLWithString:@"sms://10000"]];
上面的发短信的功能是调用系统的界面,下面是实现一种点击按键就直接发送短信,相当于后台发送,能不能上软件商店,还不能确定。相对建议来说,尽量使用第一种。
首先导入MFMessageComposeViewControllerDelegate这个代理,实现里面的方法
-(void)messageComposeViewController:(MFMessageComposeViewController *)controllerdidFinishWithResult:(MessageComposeResult)result {
//Notifies users about errors associated with the interface
switch (result) {
case MessageComposeResultCancelled:
if (DEBUG) NSLog(@"Result: canceled");
break;
case MessageComposeResultSent:
if (DEBUG) NSLog(@"Result: Sent");
break;
case MessageComposeResultFailed:
if (DEBUG) NSLog(@"Result: Failed");
break;
default:
break;
}
[self dismissModalViewControllerAnimated:YES];
}
群发短信:
- (IBAction)sendSMS {
BOOL canSendSMS = [MFMessageComposeViewController canSendText];
NSLog(@"can send SMS [%d]",canSendSMS);
if (canSendSMS) {
MFMessageComposeViewController *picker = [[MFMessageComposeViewController alloc] init];
picker.messageComposeDelegate = self;
picker.navigationBar.tintColor = [UIColor blackColor];
picker.body = @"test";
picker.recipients = [NSArray arrayWithObject:@"10086"];
[self presentModalViewController:picker animated:YES];
[picker release];
}
}
给一个人发短信:
从网页上获得内容
-(void)displaySMSComposerSheet
{
MFMessageComposeViewController *picker = [[MFMessageComposeViewController alloc] init];
picker.messageComposeDelegate = self;
UIWebView *web = nil;
NSMutableString* absUrl = [[NSMutableString alloc] initWithString:web.request.URL.absoluteString];
[absUrl replaceOccurrencesOfString:@"http://i.aizheke.com" withString:@"http://m.aizheke.com" options:NSCaseInsensitiveSearch range:NSMakeRange(0, [absUrl length])];
picker.body=[NSString stringWithFormat:@"我在爱折客上看到:%@ 可能对你有用,推荐给你!link:%@",[webstringByEvaluatingJavaScriptFromString:@"document.title"],absUrl];
[absUrl release];
[self presentModalViewController:picker animated:YES];
[picker release];
}
事件绑定发送短信
-(IBAction)showSMSPicker:(id)sender {
Class messageClass = (NSClassFromString(@"MFMessageComposeViewController"));
if (messageClass != nil) {
if ([messageClass canSendText]) {
[self displaySMSComposerSheet];
}
else {
//设备没有短信功能
}
}
else {
// iOS版本过低,iOS4.0以上才支持程序内发送短信
}
}
以上内容有一部分是来各个网站,本人自己加上自己的理解,整理,至于来源于互联网的那一部分作者是谁,来自于哪里,我现在也不知道了,写出来供大家学习。如果有你是那一部分的作者,请联系我!
Restrictions
If you could send an SMS within a program on the iPhone, you'll be able to write games that spam people in the background. I'm sure you really want to have spams from your friends, "Try out this new game! It roxxers my boxxers, and yours will be too! roxxersboxxers.com!!!! If you sign up now you'll get 3,200 RB points!!"
Apple has restrictions for automated (or even partially automated) SMS and dialing operations. (Imagine if the game instead dialed 911 at a particular time of day)
Your best bet is to setup an intermediate server on the internet that uses an online SMS sending service, and send the SMSs via that route if you need complete automation. (ie, your program on the iPhone sends a UDP packet to your server, which sends the real SMS)
iOS 4 Update
iOS 4, however, now provides a viewcontroller you can import into your application. You prepopulate the SMS fields, then the user can initiate the SMS send within the controller. Unlike using the "sms:..." url format, this allows your application to stay open, and allows you to populate both the to and the body fields. You can even specify multiple recipients.
This prevents applications from sending automated SMS without the user explicitly aware of it. You still cannot send fully automated SMS from the iPhone itself, it requires some user interaction. But this at least allows you to populate everything, and avoids closing the application.
The MFMessageComposeViewController class is well documented, and tutorials show how easy it is to implement.
iOS 5 Update
iOS 5 includes messaging for iPod touch and iPad devices, so while I've not yet tested this myself, it may be that all iOS devices will be able to send SMS via MFMessageComposeViewController. If this is the case, then Apple is running an SMS server that sends messages on behalf of devices that don't have a cellular modem.
iOS 6 Update
No changes to this class.
iOS 7 Update
You can now check to see if the message medium you are using will accept a subject or attachments, and what kind of attachments it will accept. You can edit the subject and add attachments to the message, where the medium allows it.
Limitations to this class
Keep in mind that this won't work on phones without iOS 4, and it won't work on the iPod touch or the iPad, except, perhaps, under iOS 5. You must either detect the device and iOS limitations prior to using this controller, or risk restricting your app to recently upgraded 3G, 3GS, and 4 iPhones.
However, an intermediate server that sends SMS will allow any and all of these iOS devices to send SMS as long as they have internet access, so it may still be a better solution for many applications. Alternately, use both, and only fall back to an online SMS service when the device doesn't support it.
调用打电话功能
[[UIApplicationsharedApplication] openURL:[NSURL URLWithString:@"tel://10086"]];
调用发短信功能
[[UIApplication sharedApplication]openURL:[NSURL URLWithString:@"sms://10000"]];
上面的发短信的功能是调用系统的界面,下面是实现一种点击按键就直接发送短信,相当于后台发送,能不能上软件商店,还不能确定。相对建议来说,尽量使用第一种。
首先导入MFMessageComposeViewControllerDelegate这个代理,实现里面的方法
-(void)messageComposeViewController:(MFMessageComposeViewController *)controllerdidFinishWithResult:(MessageComposeResult)result {
//Notifies users about errors associated with the interface
switch (result) {
case MessageComposeResultCancelled:
if (DEBUG) NSLog(@"Result: canceled");
break;
case MessageComposeResultSent:
if (DEBUG) NSLog(@"Result: Sent");
break;
case MessageComposeResultFailed:
if (DEBUG) NSLog(@"Result: Failed");
break;
default:
break;
}
[self dismissModalViewControllerAnimated:YES];
}
群发短信:
- (IBAction)sendSMS {
BOOL canSendSMS = [MFMessageComposeViewController canSendText];
NSLog(@"can send SMS [%d]",canSendSMS);
if (canSendSMS) {
MFMessageComposeViewController *picker = [[MFMessageComposeViewController alloc] init];
picker.messageComposeDelegate = self;
picker.navigationBar.tintColor = [UIColor blackColor];
picker.body = @"test";
picker.recipients = [NSArray arrayWithObject:@"10086"];
[self presentModalViewController:picker animated:YES];
[picker release];
}
}
给一个人发短信:
从网页上获得内容
-(void)displaySMSComposerSheet
{
MFMessageComposeViewController *picker = [[MFMessageComposeViewController alloc] init];
picker.messageComposeDelegate = self;
UIWebView *web = nil;
NSMutableString* absUrl = [[NSMutableString alloc] initWithString:web.request.URL.absoluteString];
[absUrl replaceOccurrencesOfString:@"http://i.aizheke.com" withString:@"http://m.aizheke.com" options:NSCaseInsensitiveSearch range:NSMakeRange(0, [absUrl length])];
picker.body=[NSString stringWithFormat:@"我在爱折客上看到:%@ 可能对你有用,推荐给你!link:%@",[webstringByEvaluatingJavaScriptFromString:@"document.title"],absUrl];
[absUrl release];
[self presentModalViewController:picker animated:YES];
[picker release];
}
事件绑定发送短信
-(IBAction)showSMSPicker:(id)sender {
Class messageClass = (NSClassFromString(@"MFMessageComposeViewController"));
if (messageClass != nil) {
if ([messageClass canSendText]) {
[self displaySMSComposerSheet];
}
else {
//设备没有短信功能
}
}
else {
// iOS版本过低,iOS4.0以上才支持程序内发送短信
}
}
以上内容有一部分是来各个网站,本人自己加上自己的理解,整理,至于来源于互联网的那一部分作者是谁,来自于哪里,我现在也不知道了,写出来供大家学习。如果有你是那一部分的作者,请联系我!
Restrictions
If you could send an SMS within a program on the iPhone, you'll be able to write games that spam people in the background. I'm sure you really want to have spams from your friends, "Try out this new game! It roxxers my boxxers, and yours will be too! roxxersboxxers.com!!!! If you sign up now you'll get 3,200 RB points!!"
Apple has restrictions for automated (or even partially automated) SMS and dialing operations. (Imagine if the game instead dialed 911 at a particular time of day)
Your best bet is to setup an intermediate server on the internet that uses an online SMS sending service, and send the SMSs via that route if you need complete automation. (ie, your program on the iPhone sends a UDP packet to your server, which sends the real SMS)
iOS 4 Update
iOS 4, however, now provides a viewcontroller you can import into your application. You prepopulate the SMS fields, then the user can initiate the SMS send within the controller. Unlike using the "sms:..." url format, this allows your application to stay open, and allows you to populate both the to and the body fields. You can even specify multiple recipients.
This prevents applications from sending automated SMS without the user explicitly aware of it. You still cannot send fully automated SMS from the iPhone itself, it requires some user interaction. But this at least allows you to populate everything, and avoids closing the application.
The MFMessageComposeViewController class is well documented, and tutorials show how easy it is to implement.
iOS 5 Update
iOS 5 includes messaging for iPod touch and iPad devices, so while I've not yet tested this myself, it may be that all iOS devices will be able to send SMS via MFMessageComposeViewController. If this is the case, then Apple is running an SMS server that sends messages on behalf of devices that don't have a cellular modem.
iOS 6 Update
No changes to this class.
iOS 7 Update
You can now check to see if the message medium you are using will accept a subject or attachments, and what kind of attachments it will accept. You can edit the subject and add attachments to the message, where the medium allows it.
Limitations to this class
Keep in mind that this won't work on phones without iOS 4, and it won't work on the iPod touch or the iPad, except, perhaps, under iOS 5. You must either detect the device and iOS limitations prior to using this controller, or risk restricting your app to recently upgraded 3G, 3GS, and 4 iPhones.
However, an intermediate server that sends SMS will allow any and all of these iOS devices to send SMS as long as they have internet access, so it may still be a better solution for many applications. Alternately, use both, and only fall back to an online SMS service when the device doesn't support it.
发表评论
-
UIImage变为NSData并进行压缩
2014-05-19 20:23 1946//sdk中提供了方法可以直接调用 UIImage *im ... -
update cocapods
2014-05-17 22:27 813早上更新cocoapod依赖库,发现更新到32.1版本,早先的 ... -
iOS发送短信息代码实例
2014-05-16 18:15 2693#import <MessageUI/Message ... -
DISPATCH TIMER
2014-05-14 16:12 736/* __block void (^callback) ... -
UITextField左边显示图片
2014-05-13 18:08 1181The overlay view displayed on t ... -
iOS面试题
2014-05-09 16:10 10841.写一下UIButton与UITableView的层级结构 ... -
socket二进制报文
2014-05-09 15:18 1315里面有帧头 字符串UTF-8 中间用0隔开 又一个字符串 ... -
将网站添加到桌面的方法
2014-05-08 14:25 1669<link href="http://www. ... -
iPhone通讯录联系人操作大全
2014-05-07 10:29 14701.需要引入AddressBook.framework框架 2 ... -
sqlite获取最新插入的rowid
2014-05-07 09:59 1539除了 last_insert_rowid select max ... -
号码归属地查询,拨打电话
2014-05-06 15:07 859在程序内调用拨打电话的方法,[[UIApplication s ... -
iOS时间合并
2014-04-28 17:55 1111合并同一时间的课程,同一时间可能有多个课程,比如13:30-1 ... -
vCard通讯录格式说明
2014-04-28 16:47 2570原帖:http://freesoftman.iteye.com ... -
UISearchBar背景色全套解决方案
2014-04-25 09:36 7454os系统升级到7.1后,原来在7.0下显示正常的UISearc ... -
升级XCode5.1.1遇到的奇葩问题NSString,NSObjectRuntime.h报错,Foundation找不到
2014-04-24 11:19 908升级XCode5.1.1遇到的奇葩问题NSString,NSO ... -
将NSString转为NSArray
2014-04-22 16:52 6278// Your JSON data: NSString *c ... -
另外一种NSData转为NSString的方法
2014-04-22 15:40 1221If the data is not null-termina ... -
HTTP,Socket,WebSocket异同
2014-04-18 16:54 1842参考文章: http://abbshr.g ... -
push隐藏UINavigtaionBar和UITabbar
2014-04-17 15:20 1104[self.navigationController setN ... -
数据库SQL
2014-04-11 13:31 9321、说明:创建数据库 CREATE DATABASE data ...
相关推荐
VMware workstation
光伏蓄电池单相并网模型:MPPT升压电路、桥式逆变与智能控制策略仿真结果展示,光伏蓄电池单相并网模型。 带参考文件,模型说明文件 模型内容: 1.光伏+MPPT+boost升压电路+桥式逆变 2.电池模型+电池控制器+直流母线控制 3.稳定交流负载+功率控制器+pwm调制 仿真结果: 1.直流母线380V稳定输出 2.逆变输出与单相220V电网同频同相 3.光伏功率充足时为电池充电,光伏输出不足电池放电 ,光伏蓄电池单相并网模型; 光伏MPPT; boost升压电路; 桥式逆变; 电池模型; 电池控制器; 直流母线控制; 稳定交流负载; 功率控制器; pwm调制; 380V直流母线稳定输出; 逆变输出与电网同频同相; 光伏充放电管理。,光伏储能单相并网模型:实现功率调度与电压稳定研究报告
欧洲新闻 English_Botox 肉毒杆菌行业分数据 英语 John.pdf
启蒙小游戏
基于MATLAB与Cplex求解器的冷热电多微网系统双层优化储能服务配置策略研究,MATLAB代码:基于储能电站服务的冷热电多微网系统双层优化配置 电网技术文章,《基于储能电站服务的冷热电多微网系统双层优化配置》复现 仿真平台:MATLAB,需要用到cplex求解器 ,关键词:基于储能电站服务;冷热电多微网系统;双层优化配置;MATLAB代码;cplex求解器;电网技术文章;复现;仿真平台。,"MATLAB仿真复现:多微网系统双层优化配置及其在储能电站服务的实践"
三相异步电机本体模型Matlab Simulink仿真模拟与性能研究参考模型,三相异步电机本体模型 Matlab Simulink仿真模型(成品) 本模型利用数学公式搭建了三相异步电机的模型,可以很好的模拟三相异步电机的运行性能,适合研究电机本体时修改参考,电机的各波形都很好可以很好的模拟三相电机 ,三相异步电机本体模型; Matlab Simulink仿真模型; 数学公式搭建模型; 运行性能模拟; 电机波形模拟。,基于Matlab Simulink的三相异步电机本体模型仿真研究
qt-opensource-windows-x86-5.12.12.zip.004
1、文件内容:google-guice-3.1.3-9.el7.rpm以及相关依赖 2、文件形式:tar.gz压缩包 3、安装指令: #Step1、解压 tar -zxvf /mnt/data/output/google-guice-3.1.3-9.el7.tar.gz #Step2、进入解压后的目录,执行安装 sudo rpm -ivh *.rpm 4、安装指导:私信博主,全程指导安装
1、文件内容:gnome-getting-started-docs-cs-3.28.2-1.el7.rpm以及相关依赖 2、文件形式:tar.gz压缩包 3、安装指令: #Step1、解压 tar -zxvf /mnt/data/output/gnome-getting-started-docs-cs-3.28.2-1.el7.tar.gz #Step2、进入解压后的目录,执行安装 sudo rpm -ivh *.rpm 4、安装指导:私信博主,全程指导安装
Matlab Simulink下的二阶线性自抗扰控制器(LADRC)仿真模型:快速响应与优异抗干扰性能,成功应用于电机速度控制,matlab simulink二阶线性自抗扰控制器(LADRC)仿真模型,已经封装完成,响应速度快,抗扰能力相较于传统pi更优秀。 采用线性ADRC相较于非线性ADRC大大减少了调参难度,已成功用于电机速度环替代传统pi。 ,关键词:Matlab Simulink;二阶线性自抗扰控制器(LADRC);仿真模型;封装完成;响应速度快;抗扰能力优秀;线性ADRC;调参难度低;电机速度环;传统PI替代。,Matlab Simulink:二阶线性自抗扰控制器(LADRC)仿真模型,调参简便,响应快速且抗扰性强
适用操作系统:linux。 适用CPU架构:x64。
欧洲新闻 RF Mixer(ENG) 射频混频器行业分数据 英语 Kira.pdf
1、文件内容:gnutls-c++-3.3.29-9.el7_6.rpm以及相关依赖 2、文件形式:tar.gz压缩包 3、安装指令: #Step1、解压 tar -zxvf /mnt/data/output/gnutls-c++-3.3.29-9.el7_6.tar.gz #Step2、进入解压后的目录,执行安装 sudo rpm -ivh *.rpm 4、安装指导:私信博主,全程指导安装
该工具主要实现jar包目录共享
RS422与MIL-STD-1553B协议转换:BU61580逻辑替代与扩展配置特性解析,RS422-MIL1553B 协议转 支持BC RT BM 1553B逻辑可以原位替BU61580协议芯片 配置寄存器和BU61580一样 存储器范围和BU61580一样4K*16bit 可外接扩展64K*16bit 实现过程:通过RS422去配置1553B寄存器和存储器 然后将数据通过RS422打印出来 PCI CPCI接口类似 可设计板卡也可以代码移植 ,核心关键词:RS422; MIL1553B协议转换; BC RT BM支持; 1553B逻辑原位替换BU61580协议芯片; 配置寄存器与BU61580相同; 存储器范围4K*16bit可扩展至64K*16bit; RS422配置1553B寄存器和存储器; 数据打印通过RS422; PCI CPCI接口; 设计板卡; 代码移植。,"RS422-MIL1553B协议转换卡:BU61580芯片替代方案"
内容概要:本研究围绕七鳃鳗(lamprey)适应性别比例机制,采用数学建模和生态系统评估的方法,探究了该机制对七鳃鳗种群及其所在生态系统的正面与负面影响。首先,在引入七鳃鳗生活史的基础上提出了两个模型:一是七鳃鳗种群迭代模型(Model I),二是包含物种丰富度、稳定性和生物量评估的BDS评价模型(Model II)。这两个模型共同用于量化适应性别比率对生态稳定性以及系统内部竞争动态的影响,并揭示出该比率能促进生物多样性和生物质量,但也会降低种群抵御环境压力的能力。随后,通过仿真验证,研究发现这种特性提高了整个生态系统的韧性并在环境改善时加快平衡重建速度;然而它同时也削弱了一些物种的竞争地位并减少了某些特定寄生鱼类的数量。 适用人群:对于从事生态学、动物学及相关跨学科研究人员而言是一份有价值的内容。此外,也适合作为高级生物课程的补充材料。 使用场景及目标:本文有助于深入理解入侵物种如何响应外部环境因素改变自身属性以达到适应性进化的效果,适用于那些希望进一步探索生态学中复杂互动关系的人士;也可作为教学案例,展示多维度视角下生态系统的定量研究方法和结论推导过程。 其他说明:本文提供的数据和模型不仅可用于七鳃鳗种群的具体研究中,还可以作为类似物种研究的一个通用框架来应用到其它生物类型的建模工作中去,从而提供广泛的参考价值。同时文章还指出了现有工作的局限性和未来改进的方向。
模块化多电平变换器(MMC)仿真研究:逼近调制与环流抑制策略及双闭环解耦控制揭秘,模块化多电平变器(MMC)matlab仿真 最近电平逼近调制-载波层叠-载波移相调制 二倍频负序环流抑制 子模块电容电压排序 整流 逆变—电压电流双闭环解耦控制 快速学习MMC必备 ,模块化多电平变换器(MMC); MATLAB仿真; 最近电平逼近调制; 载波层叠; 载波移相调制; 二倍频负序环流抑制; 子模块电容电压排序; 整流逆变; 电压电流双闭环解耦控制; 快速学习MMC必备。,"模块化多电平变换器(MMC)的Matlab仿真研究:多调制策略与环流抑制"
1、文件内容:glusterfs-6.0-61.el7.rpm以及相关依赖 2、文件形式:tar.gz压缩包 3、安装指令: #Step1、解压 tar -zxvf /mnt/data/output/glusterfs-6.0-61.el7.tar.gz #Step2、进入解压后的目录,执行安装 sudo rpm -ivh *.rpm 4、安装指导:私信博主,全程指导安装
重庆市公共数据资源授权运营管理实施办法(试行)(公开征求意见稿).docx
二自由度整车模型:状态空间方程与微分方程建模,质心侧偏角与横摆角速度分析,参数自定义及说明文档,二自由度整车模型 资料包含状态空间方程、微分方程两种建模方式 输入为前轮转角,输出为质心侧偏角、横摆角速度,以此进行车辆状态分析 可自定义前轮转角延时输出、自定义调节整车参数 附带说明文档 ,关键词:二自由度整车模型; 状态空间方程; 微分方程建模; 前轮转角输入; 质心侧偏角、横摆角速度输出; 车辆状态分析; 参数调节; 延时输出; 说明文档。,基于二自由度整车模型的车辆状态分析及其建模方式解析