trying to convert from java to objective-c. im havin a hard time finding anything on this subject.i get error “semantic issue” cant figure it out.
here’s the code:
-(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];
}
You need to give the target for your method as well, i.e. which instance it is called on. And of course use
:instead of[]for the arguments.[self checkColorPalette]and[self getColorFromPalette:i]