刚开始学习Obj-C;如果有天真的问题,请原谅。
我正在尝试创建一个应用程序,该应用程序根据在日期选择器中选择的日期显示自定义警报视图。
This is the code i have right now that shows a hard-coded alertview when any date is selected and the button is tapped. 我怎样才能使依赖于所选日期。
(#)import "APViewController.h"
@interface APViewController ()
@end
@implementation APViewController
@synthesize datePicker;
- (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.
}
- (IBAction)specialButton:(id)sender {
// NSDate *chosen = [datePicker date];
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Woohoo !" message:@"Its your 50th Birthday" delegate:nil cancelButtonTitle:@"Thanks" otherButtonTitles:nil];
[alert show];
}
@end