0

パラメータを取るメソッドが 3 つあります。

私はこのパラメータを与えることで例外を取っています、

[QuestionnaireView continueSingle:withQuestion:question:]: unrecognized selector sent to instance 0x8a4b1c0

私は何を間違っていますか?その定義は、ヘッダー ファイルにも記載されています。

これが私のコードです。

-(void) continueSingle:(id)sender withQuestion:(Question*)quest{

int counter = 0;

NSString * tempAnswer;

for(UIView* subview in [sender superview].subviews)
{

    if([subview isKindOfClass:[UIButton class]])
    {
        if([((UIButton*)subview) isSelected])
        {
            counter++;

            tempAnswer = [NSString stringWithFormat:@"%@",((UIButton*)subview).currentTitle];
        }
    }
}

}
4

1 に答える 1

1

あなたの間違いはここにあります

-(void) continueSingle:(id)sender withQuestion:(Question*)quest

3 つのパラメーターを渡しているのに、2 つのパラメーターしか受け取っていないためです。したがって、3つのパラメーターを取得する必要があります。このような..

-(void) continueSingle:(id)sender withQuestion:(Question*)quest question:(Question *)question1
于 2013-09-13T07:51:49.163 に答える