I got a PFQueryCollectionViewController
populated by images, everything works fine on iOS 8.x.x and below, but when I run the application on iOS 9 using Xcode 7 Beta all the images are blank.
Here's the code I use to load images from Parse in the PFQueryCollectionViewController
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath object:(PFObject *)object {
UICollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"Cell" forIndexPath:indexPath];
UIImageView *imageView = (UIImageView*)[cell viewWithTag:1];
if([object objectForKey:@"image"] != NULL) {
[[object objectForKey:@"image"] getDataInBackgroundWithBlock:^(NSData *imageData, NSError *error) {
UIImage *thumbnailImage = [UIImage imageWithData:imageData];
UIImageView *thumbnailImageView = [[UIImageView alloc] initWithImage:thumbnailImage];
imageView.image = thumbnailImageView.image;
}];
}
return cell;
}
and
- (PFQuery *)queryForCollection {
PFQuery *query = [PFQuery queryWithClassName:@"Class"];
...
return query;
}
This is probably due to SSL requirements with iOS 9. Since Parse doesn't use HTTPS for files, they won't download correctly. Set the info.plist to include keys such as this, which turn off the SSL requirements...at your own risk, of course:
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
<key>NSExceptionDomains</key>
<dict>
<key>files.parsetfss.com</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSTemporaryExceptionMinimumTLSVersion</key>
<string>TLSv1.1</string>
</dict>
</dict>
</dict>
Find Enable bitcode in Build settings in respective target AND set it to NO
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With