第一个IOS程序
来源:互联网 发布:cnc编程兼职工资怎么算 编辑:程序博客网 时间:2024/05/23 22:00
使用ios 程序实现 a+b
结果用UIAlertView 输出
1 新建一个 SIngleView IOS project
2 在 .xib 中拖入控件
3 按住ctrl键进行 refference
其中文本框使用 outlet button使用action
4 填充button对应的函数
代码如下:
- (IBAction)calc:(id)sender { int a=Text1.text.intValue; int b=Text2.text.intValue; int c=a+b; NSString *str=[[NSString alloc] initWithFormat:@"ans is %d",c]; UIAlertView *alert =[[UIAlertView alloc] initWithTitle:@"ANS" message: str delegate:nil cancelButtonTitle: @"ok~~" otherButtonTitles:nil, nil]; [alert show]; }
当然 使用点语法还要 @synthesize Text1,Text2;
0 0
- 第一个IOS程序
- 第一个IOS程序
- 第一个IOS程序
- 第一个ios程序
- IOS第一个程序helloworld
- 0811 第一个iOS程序
- 148,第一个IOS程序
- 开发第一个iOS程序
- IOS之第一个IOS程序
- ios学习笔记:第一个ios程序
- IOS开发 --- IOS 第一个程序
- 第一个ios小程序总结
- 创建第一个IOS程序 Hello World
- ios 第一个程序 简要总结
- 开始iOS第一个程序的学习
- 第一个IOS程序(代码版)
- iOS 第一个程序手工写HelloWorld
- (ios7)第一个ios程序helloworld
- 10个简单步骤,完全理解SQL
- config文件读写
- tortoisebit push出错
- PRML读书笔记:框架
- android模拟器上网
- 第一个IOS程序
- thinking in asp 之二 高端大气上档次
- Apache Hadoop 2.2.0 (2013年10月发布通告)
- 快速排序
- 1935 二叉树重建
- 【动态规划 变形】Pick numbers:实际上还是背包
- 高手速成android开源项目【View篇】
- Spring容器-Bean的生命周期
- 黑马程序员——装饰设计模式(io流)