标签:des style io ar os 使用 sp on div
实现点击一个按钮,在对应的文本框内显示当前日期时间(Xcode6.1版本)
// // ViewController.h // 1129_HelloWolrd // // Created by God Lin on 14/11/29. // Copyright (c) 2014年 arbboter. All rights reserved. // #import <UIKit/UIKit.h> @interface ViewController : UIViewController { UITextField* textTime; } @property (nonatomic, retain) IBOutlet UITextField* textTime; -(IBAction)onClickTimeBtn:(id)sender; @end
// // ViewController.m // 1129_HelloWolrd // // Created by God Lin on 14/11/29. // Copyright (c) 2014年 arbboter. All rights reserved. // #import "ViewController.h" @interface ViewController () @end @implementation ViewController @synthesize textTime; -(IBAction)onClickTimeBtn:(id)sender { if(textTime) { NSDate* date = [NSDate date]; textTime.text = [date description]; } } - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. } @end
标签:des style io ar os 使用 sp on div
原文地址:http://blog.csdn.net/arbboter/article/details/41621743