I’m trying to access photos in iOS devices using the phPhotoLibraryMBS.
I have copied most of the functionality in MBS’s Photos demo app into an iOS app but it is not fetching a collection. The same code seems to work fine on OSX.
This is the code that behaves differently:
Dim mediaType As Integer = 1 //image
Dim phType As Integer = PHAssetCollectionMBS.TypeAlbum //1
Dim phSubType As Integer = PHAssetCollectionMBS.SubtypeAny //-1
Dim options As PHFetchOptionsMBS
Dim fetchResult As PHFetchResultMBS = PHAssetCollectionMBS.fetchAssetCollectionsWithType(phType, PHsubType, options)
assetCount = 0
fileCount = 0
For i As Integer = 0 To fetchResult.countOfAssetsWithMediaType(mediaTYpe) - 1
Dim v As Variant = fetchResult.objectAtIndex(i)
Next
The app confirms that phPhtoLibraryMBS.authorisationStatus is authorised and plist includes the NSPhotoLibraryUsageDescription.
What happens with the above code is that it returns 0 as the count of assets - rather than the 6 that are in the simulator.