Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/40.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone 奇怪的Xcode警告_Iphone_Xcode - Fatal编程技术网

Iphone 奇怪的Xcode警告

Iphone 奇怪的Xcode警告,iphone,xcode,Iphone,Xcode,我在我的Picker课程中有: - (id)initWithFrame:(CGRect)frame withSender:(id)sender withDate:(NSDate*)date { if ((self = [super initWithFrame:frame])) { datePicker = [[UIDatePicker alloc] initWithFrame:CGRectMake(0, 0 , 0, 0)]; datePicker.date = date; [send

我在我的
Picker
课程中有:

- (id)initWithFrame:(CGRect)frame withSender:(id)sender withDate:(NSDate*)date {
    if ((self = [super initWithFrame:frame])) {

datePicker = [[UIDatePicker alloc] initWithFrame:CGRectMake(0, 0 , 0, 0)];
datePicker.date = date;
[sender changeDate:self.datePicker];
datePicker.date = date;

}
在sender类中:

- (void)changeDate:(id)sender {

//some code

}
这两种方法也在.h文件中声明

但当我编译时,即使一切正常,xCode告诉我:

未找到“-changeDate:”方法

参考行
[发送方变更日期:self.datePicker]


我该怎么做才能让它消失?谢谢

因为发件人具有类型id,而对于类型id,没有调用任何方法(changeDate:)。因此,如果要调用
changeDate:
方法,必须强制转换发送者,或者必须指定特定的类类型

(MySender*)MySender=(MySender*)发送方

非常感谢你!(这很明显!:-/)
- (id)initWithFrame:(CGRect)frame withSender:(MySender *)sender withDate:(NSDate*)date {