1

我正在练习一些布尔函数,我似乎被困住了,任何帮助都将不胜感激。我一定是犯了一些小错误。

-(BOOL) checkForWin
{
    if ([[dictionary valueForKey:[cowsShuffled objectAtIndex:cowsCard]] intValue]  == 2{
       return YES;
    }
}

 -(void) moo 
{
    if (checkForWin == YES) {
        NSLog (@"foo");
    }
}
4

2 回答 2

6
于 2012-09-24T11:54:24.343 回答
1

你的方法调用是错误的。您调用这样的方法:[object method].

在你的情况下[self checkForWin]

于 2012-09-24T11:54:10.477 回答