How can I change this method to get rid of the warning without anything changing?
Posted
by
user3591323
on Stack Overflow
See other posts from Stack Overflow
or by user3591323
Published on 2014-05-29T15:23:08Z
Indexed on
2014/05/29
15:24 UTC
Read the original article
Hit count: 130
objective-c
|xcode
So this question:Warning-used as the name of the previous parameter rather than as part of the selector
answers part of my problem, but I really don't want anything to change inside this method and I'm a bit confused on how this works. Here's the whole method:
-(void) SetRightWrong:(sqzWord *)word: (int) rightWrong
{
if (self.mastered==nil) {
self.mastered = [[NSMutableArray alloc]initWithCapacity:10];
}
//if right change number right
if (rightWrong == 1) {
word.numberCorrect++;
//if 3 right move to masterd list
[self.onDeck removeObject:word];
if(word.numberCorrect >= 3 )
{
[self.mastered addObject:word];
}
else
{
//if not 3 right move to end of ondeck
[self.onDeck addObject:word];
}
}
else if(rightWrong == 0)
{
//if wrong remove one from number right unless 0
NSUInteger i;
i=[self.onDeck indexOfObject:word];
word = [self.onDeck objectAtIndex:i];
if (word.numberCorrect >0) {
word.numberCorrect--;
}
}
}
The warning I am getting is: 'word' used as the name of the previous parameter than as part of the selector.
© Stack Overflow or respective owner