Why is my UILabel not updating as the datepicker changes?

前端 未结 2 1338
攒了一身酷
攒了一身酷 2021-01-28 13:28
#import \"DatePickerViewController.h\"
#import 

@interface DatePickerViewController ()


@end

@implementation DatePickerViewController

@synthesiz         


        
相关标签:
2条回答
  • 2021-01-28 13:39

    Your registration for events from the picker is using a selector that expects one argument (@selector(updateDateLabel:) expects a method of the form -updateDateLabel:(id)arg), whereas what you have implemented takes no arguments (-updateDateLabel)

    Of course, all of this is moot considering that you've reassigned your picker from the one that was de-archived from the storyboard. Remove the initialization code and hook up the IBAction to the picker in the storyboard.

    0 讨论(0)
  • 2021-01-28 13:57

    Change -(IBAction)updateDateLabel { to -(IBAction)updateDateLabel:(id)sender {

    0 讨论(0)
提交回复
热议问题