If you want to keep the UIButton
as a property, do this:
//today button
CGRect todayButtonFrame = CGRectMake(180.0, 200.0, 40.0, 40.0);
self.todayButtonDatePicker = [[UIButton alloc]initWithFrame:todayButtonFrame];
[self.todayButtonDatePicker addTarget:self action:@selector(myCustomFunction:)forControlEvents:UIControlEventTouchUpInside];
[self.todayButtonDatePicker setBackgroundImage:[UIImage imageNamed:@"today.png"] forState:UIControlStateNormal];
[self.view addSubview: self.todayButtonDatePicker];
Alternatively you can remove the property and just use a local variable.