似乎我无法获得由localIdentifier排序的获取结果。这是代码:
let sortDescriptor = NSSortDescriptor(key: "localIdentifier", ascending: true)
let options = PHFetchOptions()
options.sortDescriptors = [sortDescriptor]
let albums = PHCollection.fetchTopLevelUserCollections(with: options)
print(albums.count)
我有这个错误:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Unsupported sort descriptor in fetch options: (localIdentifier, ascending, compare:)'
但是在Apple doc中,localIdentifier可以用作密钥。