gpt4 book ai didi

ios - 实现不完整

转载 作者:可可西里 更新时间:2023-11-01 05:03:32 25 4
gpt4 key购买 nike

我在我的实现页面上收到一个不完整的实现警告,我已将其注释掉:

#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

消息的自定义部分,显示日期,选择的时间也没有正确显示。为什么?

接口(interface)文件如下:

#import <UIKit/UIKit.h>

@interface BIDDatePickerViewController : UIViewController

@property (strong, nonatomic) IBOutlet UIDatePicker *datePicker;

-(IBAction)buttonPressed;

@end

最佳答案

您收到警告的原因是因为您实现了方法 - (IBAction)buttonPressed:(id)sender,同时定义了方法 -(IBAction)buttonPressed;。请注意接口(interface)上缺少参数。

关于ios - 实现不完整,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8334275/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com