我有一個簡單的條件,其失敗:簡單的條件未能
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];
}
}
我抓2個NSNumbers從iBeacon顯示來了,我比較他們,我知道,以對應2個手動組數字。當我登錄它們時檢查數字,它們是相同的。然而,條件不接受它們是平等的,因此不會觸發。
我看不出有什麼不對,這很簡單,正如你所看到的。
任何想法或建議?
謝謝。
Oh jees,time for a coffee I reckon!謝謝。 – mrEmpty
:)沒關係,也發生在我身上 –