Objective-c BOOL总是传递

时间:2013-06-10 23:00:41

标签: ios objective-c

如何检查true或false,因为这不是

 BOOL *isLoggedIn = [[NSUserDefaults standardUserDefaults] boolForKey:kSignedInBool];
BOOL *userSignedUp = [[NSUserDefaults standardUserDefaults] boolForKey:kHasUserEverSignedUpBool];

if(userSignedUp == NO || isLoggedIn == NO) { // they don't have an account so can't sign in.

    //Show the modal opening screen path

    [self performSegueWithIdentifier:@"showOpeningScreen" sender:self];

} else { //

    // We have signed up before so findNearbyamulanes
    [self performSelector:@selector(findNearByAmbulances) withObject:nil afterDelay:4.0];
}

1 个答案:

答案 0 :(得分:10)

您不应该使用具有基本数据类型的指针。

BOOL *更改为BOOL

编辑:对指针的(有点荒谬但有用)视频的强制性link