我已经检查了所有关于此的文章,我无法弄清楚如何解决这个问题。
我正在编写一个应用程序,它将从选择器(有两列)中获取信息,并在按下按钮后将其填充到标签中。没有崩溃或任何事情。日志中唯一的一行是: Interface Builder文件中的未知类*** PickerView。 我试图清除构建和我发现的其他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;
}
}
}
有什么建议吗?