您的位置:首页 > 移动开发 > IOS开发

黑马入门教程笔记00-iOS开发初体验

2015-08-30 13:51 369 查看
iOS开发体验:
http://www.imooc.com/video/4698
学习OC前请务必先学习C

问:main函数?

答:main函数的参数列表保存了输入参数的信息,第一个参数argc记录了输入参数的个数,第二个参数是字符串数组的,字符串数组的每个单元是char*类型的,指向一个c风格字符串。argv就是输入的运行程序.



1、模拟器快捷键

command +shift + H 等同于Home

command + 1 大屏幕

command + 2 中屏幕

command + 3 小屏幕

2、弹出提醒对话框

- (IBAction)btn_clik:(id)sender {
//    NSLog(@"hello eric");
//定义一个对话框
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"第一次" message:@"我滴错一次" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确定", nil];
//显示对话框
[alert show];
}


3、拨打电话和发送短信

- (IBAction)callToGod:(id)sender {
//1.设定电话号码
NSURL *url = [NSURL URLWithString:@"tel://10010"];
//2.调用iOS系统拨号功能
[[UIApplication sharedApplication] openURL:url];
}


- (IBAction)textToGod:(id)sender {
//1.设定接收短信的人
NSURL *url = [NSURL URLWithString:@"sms://10086"];
//2.填写短信内容
[[UIApplication sharedApplication] openURL:url];
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: