Context
I use Parse.com as my backend. Parse lets you have the ability to store an array of pointers to another one of your classes. In my case, for each user, if they are a business owner, I have an array of pointers to the businesses they own. The array looks like this: [{"__type":"Pointer","className":"Businesses","objectId":"auUS4I8ILh”}]
Now, in my application, I have a class that allows users to post to a timeline. If the user is also a business owner, it will allow the user to decide between posting as themselves or as the business they own. In order to do this, when I query for the user that's posting, I include the key that holds the array of pointers in my "_User" class.
Issue
Okay so my issue is when I'm trying to get the information out of the array of pointers. If I print the current user out to the console, it clearly shows the information in that column, as shown below. However, I can't figure out a good way to access this information.
Originally, I tried this:
if let businessOwner: [AnyObject] = self.currentUser.objectForKey("BusinessOwner") as! [AnyObject] {...}
After this, the next part of the code is supposed to get the object id's by iteration so that I can query for the business' information:
for business in businessOwner {
objectIDArray.append(business.objectId as! String)
}
This originally worked when there was only one business in the array of pointers, but eventually even that stopped working. I've tried changing some things here and there, but the two problems I continually run into are: 1) the if...let statement just falls through, indicating that there was nothing to put into the businessOwner array (which I know isn't true because I can see the print out in the console), or 2) that the businessOwner array is instantiated and filled, but then the program crashes when trying to access the object id of the business, presumably related to the way I'm trying to access the string that is the object's id.
For clarification's sake, here is what the dictionary looks like after the business is assigned during iteration:

So in essence, what do I have to do to assign the objects in my "BusinessOwner" column to an array, and then, how can I get the object id's in order to use them for my query? I've been fighting this issue for a couple of days. If anyone could help me out here it would be awesome.