Incomplete implementation

I get a warning about an incomplete implementation on my implementation page, which I commented on:

#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. // eg self.myOutlet = nil; self.datePicker = nil; } @end 

Also, the custom part of the message showing the date, the selected time is not displayed correctly. Why?

The following is the interface file:

 #import <UIKit/UIKit.h> @interface BIDDatePickerViewController : UIViewController @property (strong, nonatomic) IBOutlet UIDatePicker *datePicker; -(IBAction)buttonPressed; @end 
+4
source share
2 answers

The reason you get the warning is because you implemented the - (IBAction)buttonPressed:(id)sender method, while you defined the -(IBAction)buttonPressed; . Note the absence of an argument in the interface.

+13
source

In your .h file, you have - (IBAction)buttonPressed; , and in your .m file there is - (IBAction)buttonPressed:(id)sender . You must have - (IBAction)buttonPressed; in your .m file

0
source

Source: https://habr.com/ru/post/1384002/


All Articles