我使用這link作爲指導,但我可以找出如何使用AND子句進行解析。它只在示例代碼中定義OR子句。我怎樣才能得到AND子句解析ios
如果我是把它從SQL語句轉換,它看起來像這樣...
SELECT * FROM RemittanceTable WHERE beneCode = 'code' AND remittanceAmount = 500.00
例如,在這段代碼中,我要檢查如果代碼和金額,如果正確讀取數據之前。但它證實與OR子句
PFQuery *beneCodeQuery = [PFQuery queryWithClassName:@"RemittanceTable"];
[beneCodeQuery whereKey:@"beneCode" containsString:_beneCodeText.text];
PFQuery *amountQuery = [PFQuery queryWithClassName:@"RemittanceTable"];
[amountQuery whereKey:@"remittanceAmount" equalTo:amount];
PFQuery *query = [PFQuery orQueryWithSubqueries:[NSArray arrayWithObjects:beneCodeQuery,amountQuery,nil]];
[query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) {
if (!error) {
for (PFObject *object in objects) {
NSLog(@"%@", object);
[self resignAllResponder];
_paymentDetailsImage.frame = CGRectMake(_paymentDetailsImage.frame.origin.x, _paymentDetailsImage.frame.origin.y, _paymentDetailsImage.frame.size.width, paymentModeOrigHeight);
_detailsView.alpha = 1;
}
}}}];
我已編輯d我的問題 – lhencq