Obj-C の学習を始めたばかりです。もしあれば素朴な質問を許してください。
日付ピッカーで選択した日付に基づいてカスタム アラート ビューを表示するアプリケーションを作成しようとしています。
これは私が今持っているコードで、任意の日付が選択されてボタンがタップされたときにハードコーディングされたアラートビューを表示します。選択した日付に依存させるにはどうすればよいですか。
(#)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