Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Incomplete implementation

Tags:

xcode

ios

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
like image 911
pdenlinger Avatar asked Dec 13 '22 07:12

pdenlinger


1 Answers

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.

like image 99
Marc Charbonneau Avatar answered Dec 14 '22 23:12

Marc Charbonneau