This code worked fine in iOS 7 but in iOS 8.1 all assets located in the "My Photo Stream" album are nil from within the result block. (The failureBlock is not called.) Regular albums and shared albums work just fine.
I tried the accepted answer from: Error trying to assigning __block ALAsset from inside assetForURL:resultBlock:
That is, I'm holding a reference to an ALAssetsLibrary object, listening for the ALAssetsLibraryChangedNotification
event (which doesn't happen btw, but oh well.) I made sure my app has permission to access photos, I'm on wi-fi, I see the photos' thumbnails just fine in my tableView. It's just when I try to load them with assetForURL:
they're always nil.
// example URL: assets-library://asset/asset.JPG?id=1ECB69B9-DC7A-45A7-B135-F43317D3412C&ext=JPG
[self.library assetForURL:[NSURL URLWithString:url] resultBlock:^(ALAsset *asset) {
NSLog(@"Asset: %@", asset); // nil :(
} failureBlock:^(NSError *error) {
NSLog(@"Failure, wahhh!");
}];
Is anyone else seeing this issue?
item.url
should be justurl
correct? And we'd probably need to call a success block that passes in the ALAsset. Thanks again! – Dovev