In my app the user can view his own statistics. I retrieve an array from Parse like this:
...
[query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) {
userArray = [objects valueForKey:@"myArray"];
}];
The code works just fine when the array actually contains something... But if nothing is saved to the array in Parse.com I get errors..
Example: I run this code to test:
NSLog(@"%lu", (unsigned long)[[userArray objectAtIndex:0] count]);
When the array contains something it logs the correct number (works). But when the array is empty I get this error:
"-[NSNull count]: unrecognized selector sent to instance 0x199084fe0"
I can't figure out what is going on.. Anyone has an idea what is happening?