Platforms to show: All Mac Windows Linux Cross-Platform
PHFetchResultMBS class
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
class | Photos | MBS Mac64bit Plugin | 20.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | Desktop & iOS |
When you use class methods on the PHAssetMBS, PHCollectionMBS, PHAssetCollectionMBS, and PHCollectionListMBS classes to retrieve objects, Photos provides the resulting objects in a fetch result. You access the contents of a fetch result with various methods. Unlike an array, however, a PHFetchResult object dynamically loads its contents from the Photos library as needed, providing optimal performance even when handling a large number of results.
A fetch result provides thread-safe access to its contents. After a fetch, the fetch result’s count value is constant, and all objects in the fetch result keep the same localIdentifier value. (To get updated content for a fetch, register a change observer with the shared PHPhotoLibraryMBS object.)
A fetch result caches its contents, keeping a batch of objects around the most recently accessed index. Because objects outside of the batch are no longer cached, accessing these objects results in refetching those objects. This process can result in changes to values previously read from those objects.
- 4 properties
- property count as Integer
- property firstObject as Variant
- property Handle as Integer
- property lastObject as Variant
- 9 methods
- method allObjects as Variant()
- method Constructor
- method containsObject(anObject as Variant) as Boolean
- method copy as PHFetchResultMBS
- method countOfAssetsWithMediaType(MediaType as Integer) as Integer
- method indexOfObject(anObject as Variant) as Integer
- method indexOfObject(anObject as Variant, range as NSRangeMBS) as Integer
- method objectAtIndex(index as Integer) as Variant
- method objectsAtIndexes(indexes as NSIndexSetMBS) as Variant()
- shared method available as boolean
- 13 constants
Edit Operation
Constant | Value | Description |
---|---|---|
EditOperationContent | 2 |
The asset’s photo or video content can be edited. To begin the process of editing an asset, use the requestContentEditingInputWithOptions method. |
EditOperationDelete | 1 |
The asset can be deleted from the photo library. To delete one or more assets, create a change request with the deleteAssets method inside a PHPhotoLibrary change block. |
EditOperationProperties | 3 |
The asset’s metadata properties can be edited. To change an asset’s properties, create a change request with the changeRequestForAsset method inside a PHPhotoLibraryMBS change block. |
Media Types
Constant | Value | Description |
---|---|---|
MediaTypeAudio | 3 |
The asset is an audio file. |
MediaTypeImage | 1 |
The asset is a photo or other static image. |
MediaTypeUnknown | 0 |
The asset’s type is unknown. |
MediaTypeVideo | 2 |
The asset is a video file. |
Asset Playback Styles
Constant | Value | Description |
---|---|---|
PlaybackStyleImage | 1 |
The asset should be displayed as a still image. |
PlaybackStyleImageAnimated | 2 |
The asset should be displayed as an animated image. |
PlaybackStyleLivePhoto | 3 |
The asset should be displayed as a Live Photo. |
PlaybackStyleUnsupported | 0 |
The asset has an unsupported or undefined media playback type. |
PlaybackStyleVideo | 4 |
The asset should be displayed as a video. |
PlaybackStyleVideoLooping | 5 |
The asset should be displayed as a looping video. |
This class has no sub classes.
Some methods using this class:
- PHAssetCollectionMBS.fetchAssetCollectionsContainingAsset(asset as PHAssetMBS, type as Integer, options as PHFetchOptionsMBS = nil) as PHFetchResultMBS
- PHAssetCollectionMBS.fetchAssetCollectionsWithLocalIdentifiers(identifiers() as string, options as PHFetchOptionsMBS = nil) as PHFetchResultMBS
- PHAssetCollectionMBS.fetchAssetCollectionsWithType(type as Integer, subType as integer, options as PHFetchOptionsMBS = nil) as PHFetchResultMBS
- PHAssetMBS.fetchAssets(options as PHFetchOptionsMBS = nil) as PHFetchResultMBS
- PHAssetMBS.fetchAssetsInAssetCollection(assetCollection as PHAssetCollectionMBS, options as PHFetchOptionsMBS = nil) as PHFetchResultMBS
- PHAssetMBS.fetchAssetsWithLocalIdentifiers(identifiers() as String, options as PHFetchOptionsMBS = nil) as PHFetchResultMBS
- PHChangeMBS.changeDetailsForFetchResult(FetchResult as PHFetchResultMBS) as PHFetchResultChangeDetailsMBS
- PHCollectionListChangeRequestMBS.changeRequestForCollectionList(collectionList as PHCollectionListMBS, childCollections as PHFetchResultMBS) as PHCollectionListChangeRequestMBS
- PHCollectionListMBS.fetchCollectionListsWithLocalIdentifiers(identifiers() as string, options as PHFetchOptionsMBS = nil) as PHFetchResultMBS
- PHCollectionListMBS.transientCollectionListWithCollectionsFetchResult(fetchResult as PHFetchResultMBS, title as String) as PHCollectionListMBS
Some properties using for this class:
- PHFetchResultChangeDetailsMBS.fetchResultAfterChanges as PHFetchResultMBS
- PHFetchResultChangeDetailsMBS.fetchResultBeforeChanges as PHFetchResultMBS
Some examples using this class:
Blog Entries
The items on this page are in the following plugins: MBS Mac64bit Plugin.
PHFetchResultChangeDetailsMBS - PhidgetAccelerometerMBS