I have setup a Parse.com backend. In my iOS application I have connection with this backend and am able to retrieve the objects stored.
I want each specific object to be stored in an array. Let's say the objects where my Key:value is for example: Category = Coffeebars
For now I have written the following code:
let queryToGetBuildings = PFQuery(className: "Building")
queryToGetBuildings.findObjectsInBackgroundWithBlock { (objects, error) -> Void in
if error == nil {
for object in objects!{
print("this is an object")
print(object)
}
} else {
print("something went wrong")
}
Which returns each of my objects separate:
"this is an object"
<Building: 0x7f, objectId: yh, localId: (null)> {
BottomText = "Opened from";
BottomTextExtra = "05:00 until 22:00";
Category = Coffeebars;
MiddleText = "Suggestion:";
MiddleTextExtra = "Apple and cinnamon";
TimeToDestination = 5;
TopText = Starbucks;
}
"this is an object"
<Building: 0xr, objectId: Xj, localId: (null)> {
BottomText = "Fee per person (not for babies):";
BottomTextExtra = "0.20";
Category = Toilets;
MiddleText = "Men - Women - Babies";
MiddleTextExtra = " ";
TimeToDestination = 5;
TopText = "Bathroom 2 terminal A";
}
"this is an object"
<Building: 0pr, objectId: 2q, localId: (null)> {
BottomText = "Fee per person (not for babies):";
BottomTextExtra = "0.20";
Category = Toilets;
MiddleText = "Men - Women";
MiddleTextExtra = " ";
TimeToDestination = 8;
TopText = "Bathroom 3 terminal A";
}
My main question now is how can I print out (and add to a specific Array) all information for an object with Key:Value = Category:Toilets?
Thanks in advance