1

我正在枚举一个 PHFetchResult。如果我对返回的 PHAsset 执行 println,我会得到:

<PHAsset: 0x178192140> 4CBE5A4F-90BD-438B-954E-6FF1B14538CD/L0/001 mediaType=1/0, assetSource=3, (2448x3264), creationDate=2014-10-15 14:20:12 +0000, location=1, hidden=0, favorite=1

有谁知道assetSource=3比特是什么?如果可能的话,我想在assetSource 上运行一个谓词,但在任何地方都找不到关于它是什么或如何访问它的任何信息。是私人的吗?

4

2 回答 2

2

assetSource是一个私有变量,所以它的含义是故意不透明的。

可以使用谓词从中过滤assetSourcedescription进一步调查,就像在这个问题中一样,但这将是一个纯粹的学术练习。

于 2014-10-15T22:45:50.097 回答
0

可能与 iOS9 中即将推出的 PHAssetSourceType 有关。

struct PHAssetSourceType : OptionSetType {
init(rawValue rawValue: UInt)
static var TypeNone: PHAssetSourceType { get }
static var TypeUserLibrary: PHAssetSourceType { get }
static var TypeCloudShared: PHAssetSourceType { get }
static var TypeiTunesSynced: PHAssetSourceType { get }

}

参考https://developer.apple.com/library/prerelease/ios/documentation/Photos/Reference/PHAsset_Class/index.html#//apple_ref/swift/struct/c:@E@PHAssetSourceType

于 2015-09-02T15:41:37.857 回答