试图从java转换为objective-c。我很难找到有关此主题的任何内容。我收到错误“语义问题”无法弄清楚。这是代码:
-(void) createColorPalatte{
for (int i=0; i<4; i++) {
colorPalatte[i] = [self getRandomColor];
}}
-(BOOL) checkColorPalatte {
for (int i=0; i<4; i++) {
for (int j=i+1; j<4; j++) {
if ([getColorFroemPalatte[i]]==[getColorFromPalatte[j]] ) {
return YES;
}
}
}
return NO;
}
-(void) redoColorPalatte {
while (YES==[checkColorPalatte];) {
[createColorPalatte];
}
}
-(char) getColorFromPalatte: (int) index{
return colorPalatte[index];
}