如何更改此代码,使其具有HH:MM:SS(小时,分钟,秒,
你能告诉我是否需要在.h或.m中添加代码以便我知道哪一个
此刻它会像1,2,3,4等一样上升
嗨,大家只是为了让你知道我是一个业余的诱饵你会复制和过去所以我知道你的意思谢谢
亲切的问候
保罗
.H
@interface FirstViewController : UIViewController {
IBOutlet UILabel *time;
NSTimer *myticker;
//declare baseDate
NSDate* baseDate;
}
-(IBAction)stop;
-(IBAction)reset;
@end
Run Code Online (Sandbox Code Playgroud)
.M
#import "FirstViewController.h"
@implementation FirstViewController
-(IBAction)start {
[myticker invalidate];
baseDate = [NSDate date];
myticker = [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(showActivity) userInfo:nil repeats:YES];
}
-(IBAction)stop;{
[myticker invalidate];
myticker = nil;
}
-(IBAction)reset;{
time.text = @"00:00:00";
}
-(void)showActivity {
NSTimeInterval interval = [baseDate timeIntervalSinceNow];
NSUInteger seconds = ABS((int)interval);
NSUInteger minutes = seconds/60;
NSUInteger hours = minutes/60;
time.text = …Run Code Online (Sandbox Code Playgroud) 我有Xcode 4.2,我正在尝试创建一个下拉菜单.我希望下拉菜单下拉单词或数字.然后,当我从列表中选择某些内容时,我希望它出现在不同页面上的表格中.我的问题是:我怎么写这个?谢谢