* 결과가 0 또는 1의 부울을 반환하도록 설정됩니다. 결과가 1의 값을 반환하면 아래 문을 로그에 기록해야합니다.if 문에서 정수를 가리키는 포인터와 비교
내 기록에 따르면 1의 결과가 성공적으로 기록되고 두 번째 명령문 인 "모든 설정, MatchCenter로 보내 드리겠습니다"가 기록됩니다. 두 번째 if 문이 올바른 위치에 없거나 구문이 올바르지 않은지 확실하지 않습니다. 어떤 도움을 주셔서 감사합니다.
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if (sender != self.nextButton) return;
if (self.itemSearch.text.length > 0) {
[PFCloud callFunctionInBackground:@"eBayCategorySearch"
withParameters:@{@"item": self.itemSearch.text}
block:^(NSString *result, NSError *error) {
if (!error) {
NSLog(@"The result is '%@'", result);
if ((int)result == 1) {
NSLog(@"All set, let's send you to MatchCenter");
}
}
}];
}
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
'int'에'result'를 주조하면 포인터 (메모리 주소)가'int'로 형 변환됩니다. 텍스트 값을'int'로 변환하는 데는 그다지 가깝지 않습니다. – rmaddy