-3
PFQuery *query = [PFQuery queryWithClassName:@"Category"];
// Retrieve the object by id
[query findObjectsInBackgroundWithBlock:^(NSArray * _Nullable objects, NSError * _Nullable error) {
// Now let's update it with some new data. In this case, only cheatMode and score
// will get sent to the cloud. playerName hasn't changed.
// NSLog(@"%@",[objects objectAtIndex:1]);
// NSLog(@"%@",[objects valueForKey:@"mensClothingType"]);
NSArray * result = [[objects valueForKey:@"mensClothingType"] componentsJoinedByString:@""];
NSLog(@"%@",result);
}];
}
我如何從對象中獲取所有'mensClothingType'並將其放入一個數組中?目前,如果我讀出數組「對象」我怎樣才能把這個數組放入一個數組?
我得到這個:
(
(
Shirts
),
(
Jeans
)
)
更新您的一些相關的代碼的問題,表明你已經嘗試過的東西。解釋你在嘗試中遇到了什麼問題。 – rmaddy
看一下'NSArray'方法'arrayByAddingObjectsFromArray'。如果你發佈你的代碼和你已經嘗試過,我們可以告訴你如何使它工作。 –
我更新了@rmaddy – farhan