iPhone控件之UIDatePicker
#import "UITestViewController.h"
@implementation UITestViewController
- (void)pickerChanged:(id)sender
{
NSLog(@"value: %@",[sender date]);
}
- (void)viewDidLoad {
[super viewDidLoad];
CGRect pickerFrame = CGRectMake(0,120,0,0);
UIDatePicker *myPicker = [[UIDatePicker alloc] initWithFrame:pickerFrame];
[myPicker addTarget:self action:@selector(pickerChanged:) forControlEvents:UIControlEventValueChanged];
[self.view addSubview:myPicker];
[myPicker release];
}