2015-07-05 40 views
-1

我想從查詢中獲取指針列中的所有對象。我有一個名爲A的對象類,它包含一個指向對象B的指針列。(只有1個對象)我有一個查詢A,我想從該查詢中獲取所有B對象。所以我試圖做這樣的事情...解析獲取指針列中的所有對象

var queryA = PFQuery(classname: "A"); 
queryA.whereKey("level", equalTo: 1); 

var queryB = PFQuery(classname: "B);// not sure if this is necessary 
//here I couldn't find anything, this should be something like 
//get objects from queryA's "objectB" column 
//After merging the column key with queryB (assuming I can) 
queryB.whereKey("games", lessThan: 5); //I add constraints 

當我嘗試使用queryB.whereKey(「鑰匙」,matchesKey:「對象B」,inQuery:queryA)它不會因爲工作「objectB」鍵指向B對象而不是其中的一個鍵。你們有什麼想法嗎? (任何回答都非常感謝,我可以理解Objective-C以及Swift)

回答

0

您可以使用includeKey()方法執行此操作。它將獲得指針列的相關數據。第二個查詢(queryB)是不必要的。