iOS_1_加法器
2015-06-06 08:37
375 查看
:
BeyondViewController.h
BeyondViewController.m
BeyondViewController.h
// // BeyondViewController.h // 01_calc // // Created by beyond on 14-7-20. // Copyright (c) 2014 com.beyond. All rights reserved. // #import <UIKit/UIKit.h> @interface BeyondViewController : UIViewController // IBOutlet IBAction,,storyboard // , @property (nonatomic,weak) IBOutlet UITextField *num1; @property (nonatomic,weak) IBOutlet UITextField *num2; @property (nonatomic,weak) IBOutlet UILabel *result; // button - (IBAction)btnClick:(UIButton *)sender; @end
BeyondViewController.m
// // BeyondViewController.m // 01_calc // // Created by beyond on 14-7-20. // Copyright (c) 2014 com.beyond. All rights reserved. // #import "BeyondViewController.h" @interface BeyondViewController () @end @implementation BeyondViewController - (void)viewDidLoad { [super viewDidLoad]; } #pragma mark - button, // button - (IBAction)btnClick:(UIButton *)sender { // viewson NSLog(@"view%dson",self.view.subviews.count); // buttontag4 if (4==sender.tag) { NSLog(@"button %@",sender); // 1,,2,self // UITextField *textField1=_num1; NSString *n1=self.num1.text; NSString *n2=self.num2.text; NSLog(@"1 %@ 2 %@",n1,n2); int result=[n1 intValue]+[n2 intValue]; self.result.text=[NSString stringWithFormat:@"%d",result]; } switch ([sender tag]) { case 1: NSLog(@"tag1button"); break; case 2: NSLog(@"tag2button"); break; default: break; } // BeyondViewController NSLog(@"self %@",self); [_num1 resignFirstResponder]; [_num2 resignFirstResponder]; } @end
相关文章推荐
- 猫猫学iOS 之微博项目实战(2)微博主框架-自定义导航控制器NavigationController
- github优秀开源项目大全-iOS
- ios开发----应用数据存储的常用方法之plist存取方法
- iOS开发数据持久化技术02——plist介绍
- iOS开发数据持久化技术01——NSUserDefault介绍
- 支付宝SDK IOS
- 玩转 IOS 开发 - block 使用详解
- IOS初学收获,第一天视频
- iOS开发 多线程之”GCD“
- iOS适配
- iOS - 版面实现记录五
- iOS 工作备注
- IOS 开源项目
- IOS 如何选择delegate、notification、KVO?
- iOS战记 ----OC基础语法之战(三)
- iOS战记 ----OC基础语法之战(二)
- 如何将Nios II硬件和软件合成一个文件(NIOS II)烧进EPCS falsh
- IOS开发类书--目录总结
- iOS:KVO/KVC 的概述与使用
- iOS开发者遇到审核失败的原因及解决办法