84669 person learning
152542 person learning
20005 person learning
5487 person learning
7821 person learning
359900 person learning
3350 person learning
180660 person learning
48569 person learning
18603 person learning
40936 person learning
1549 person learning
1183 person learning
32909 person learning
现需功能:选择的本地相册照片上传,如果上传过程中中断。下次开启程序可以继续上传任务。遇到问题:选择的本地照片数据PHAsset不遵守NSCoding协议,无法归档。寻求本地保存的方案。或者此功能更好的解决方案。感谢!
闭关修行中......
If you can’t save it directly, just find a mark and record it. Next time, use this mark to filter and get the original object. So I looked for the documentation and there happened to be something like this:
(PHFetchResult<PHAsset > )fetchAssetsWithLocalIdentifiers:(NSArray<NSString > )identifiers options:(nullable PHFetchOptions *)options;
identifiers just pass the localIdentifier of PHAsset: @property (nonatomic, copy, readonly) NSString *localIdentifier;
Save the localIdentifier and use this to filter next time you open it
To prevent the picture from being deleted, the best solution is to move it to the app’s file directory. Just remove it after uploading.
Owner, I also encountered the same problem, please tell me how to solve it.
If you can’t save it directly, just find a mark and record it. Next time, use this mark to filter and get the original object.
So I looked for the documentation and there happened to be something like this:
(PHFetchResult<PHAsset > )fetchAssetsWithLocalIdentifiers:(NSArray<NSString > )identifiers options:(nullable PHFetchOptions *)options;
identifiers just pass the localIdentifier of PHAsset:
@property (nonatomic, copy, readonly) NSString *localIdentifier;
Save the localIdentifier and use this to filter next time you open it
To prevent the picture from being deleted, the best solution is to move it to the app’s file directory. Just remove it after uploading.
Owner, I also encountered the same problem, please tell me how to solve it.