1

我已经检查了我能找到的所有文章,但我不知道如何解决这个问题。

我正在编写一个应用程序,它将从选择器(有两列)中获取信息,并在按下按钮后将其填充到标签中。没有崩溃或任何事情。日志中唯一的一行是:Unknown class ***PickerView in Interface Builder file。我已经尝试清除构建和我发现的其他 4 个建议,但我无法摆脱它。PickerView 在编译源中。

这是标签更新的代码(忽略我注释掉的内容,iPhone 与 xib 上的间距不同):

-(IBAction)buttonPressed
{
    NSInteger jobRow = [doublePicker selectedRowInComponent:kJobsList];
    NSInteger hourRow = [doublePicker selectedRowInComponent:kHoursList];

    NSString *job = [jobTypes objectAtIndex:jobRow];
    NSString *hour = [hoursTypes objectAtIndex:hourRow];

    NSString *message = [[NSString alloc] initWithFormat:@"%@     %@", job, hour];
    int /*one=0, two=0,*/ three=0, four=0, five=0, six=0;
    bool done = YES;
    while(!done)
    {
        /*if(one == 0)
        {
            label1.text = message;
            one = 1;
            done = NO;
            break;
        }
        if(two == 0)
        {
            label2.text = message;
            two = 1;
            done = NO;
            break;
        }*/
        if(three == 0)
        {
            self.label3.text = message;
            [label3 setNeedsDisplay]; // This is a line of something I found online to try
            three = 1;
            done = NO;
            break;
        }
        if(four == 0)
        {
            self.label4.text = message;
            four = 1;
            done = NO;
            break;
        }
        if(five == 0)
        {
            self.label5.text = message;
            five = 1;
            done = NO;
            break;
        }
        if(six == 0)
        {
            self.label6.text = message;
            six = 1;
            done = NO;
            break;
        }
    }
}

有什么建议么?

4

0 回答 0