【文件属性】:
文件名称:ios开发的简单计算器
文件大小:59KB
文件格式:ZIP
更新时间:2017-03-19 06:18:10
ios 委托 简单计算器
ios 委托 简单计算器
- (IBAction)Result:(UIButton *)sender {
NSString *string;
int a = self.i;
string = [[NSString alloc]initWithFormat:@"%d",a];
int length = [string length];
self.j = [[self.Number.text substringFromIndex:length+1] floatValue];
switch (self.counter) {
case 1:
self.i = self.i*self.j;
break;
case 2:
self.i = self.i+self.j;
break;
case 3:
self.i = self.i-self.j;
break;
case 4:
self.i = self.i/self.j;
break;
default:
break;
}
self.Number.text = [NSString stringWithFormat:@"%2f",self.i];
}
【文件预览】:
counter计算器
----.DS_Store(6KB)
----counter.xcodeproj()
--------project.xcworkspace()
--------xcuserdata()
--------project.pbxproj(19KB)
----counter()
--------TRViewController.h(215B)
--------.DS_Store(6KB)
--------TRAppDelegate.m(2KB)
--------en.lproj()
--------TRViewController.xib(18KB)
--------main.m(337B)
--------TRViewController.m(3KB)
--------counter-Info.plist(1KB)
--------TRAppDelegate.h(277B)
--------Images.xcassets()
--------counter-Prefix.pch(344B)
----counterTests()
--------counterTests-Info.plist(690B)
--------counterTests.m(632B)
--------en.lproj()