내가 실패하는 간단한 조건이 있습니다간단한 조건 실패
NSNumber *beaconMajor = [NSNumber numberWithInt:33995];
NSNumber *beaconMinor = [NSNumber numberWithInt:59204];
NSNumber *incommingMajor = beacon.major;
NSNumber *incommingMinor = beacon.minor;
NSLog(@"%d", [beaconMajor integerValue]);
NSLog(@"%d", [incommingMajor integerValue]);
NSLog(@"Pre big conditional");
//if the beacon is the one for the test content AND we are very near to it, show that content
if (incommingMinor == beaconMinor) {
NSLog(@"Into big conditional");
if (beacon.proximity == CLProximityImmediate) {
[self performSegueWithIdentifier:@"mainToContent" sender:self];
}
}
내가 아이 비콘에서 오는 두 NSNumbers를 잡는거야, 나는 대응 알이 개 수동으로 세트를 숫자로 비교하고있다. 내가 로그 할 때 번호를 확인하십시오, 동일합니다. 그러나 조건부가 동등한 것으로 간주하지 않으므로 트리거되지 않습니다.
나는 이상한 것을 볼 수 없으며 볼 수있는 것처럼 매우 간단합니다.
의견이나 제안이 있으십니까?
감사합니다. 당신은 다른 메모리 주소로 beaconMinor
및 incommingMinor
점으로 동일하지 않습니다 포인터 주소를 비교하는
if ([incommingMinor intValue] == [beaconMinor intValue])
오, 제 커피 시간입니다! 감사. – mrEmpty
:) 괜찮습니다. 나에게도 일어났습니다. –