I'm getting an incomplete implementation warning on my implementation page, which I have commented out:
#import "BIDDatePickerViewController.h"
@implementation BIDDatePickerViewController // Incomplete implementation
@synthesize datePicker;
- (IBAction)buttonPressed:(id)sender
{
NSDate *selected = [datePicker date];
NSString *message = [[NSString alloc] initWithFormat:@"The date and time you selected is:%@", selected];
UIAlertView *alert = [[UIAlertView alloc]
initWithTitle:@"Date and Time Selected"
message:message
delegate:nil
cancelButtonTitle:@"Yes I did"
otherButtonTitles:nil];
[alert show];
}
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
NSDate *now = [NSDate date];
[datePicker setDate:now animated:NO];
}
- (void)viewDidUnload
{
[super viewDidUnload];
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
self.datePicker = nil;
}
@end
Also the custom part of the message, showing date, time chosen is not showing up correctly. Why?
Following is the interface file:
#import <UIKit/UIKit.h>
@interface BIDDatePickerViewController : UIViewController
@property (strong, nonatomic) IBOutlet UIDatePicker *datePicker;
-(IBAction)buttonPressed;
@end
The reason you're getting a warning is because you implemented the method - (IBAction)buttonPressed:(id)sender
, while you defined the method -(IBAction)buttonPressed;
. Note the lack of an argument on the interface.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With