Post

Replies

Boosts

Views

Activity

Does PHAsset localIdentifier change after device transfer?
Hi, I’m working on a photo backup app. I track the PHAsset localIdentifier to determine which photos have been backed up and which haven’t. Recently, I’ve noticed that two users seem to have experienced the localIdentifier changes after transferring data to a new iPhone using Quick Start. Additionally, others on StackOverflow have mentioned that the localIdentifier sometimes changes after updating the iOS version. https://stackoverflow.com/questions/40094728/phobject-localidentifier-reliability I’d like to confirm the reliability of the localIdentifier after an iOS version upgrade or device transfer. Can I continue using these locally stored localIdentifiers? Or is there another recommended approach, such as using PHCloudIdentifier?
2
0
225
2w
Available Storage displayed in iOS setting is not correct
Hi~recently I have storage issue as follows: Go to iOS Settings -> iPhone Storage , it shows available  storage  is enough (ex.180.38 GB) But app will get disk full error when trying to write large file (ex. 26 GB) Error Domain=NSCocoaErrorDomain Code=640 "The file couldn’t be saved because there isn’t enough space." UserInfo={NSUnderlyingError=0x282db8ae0 {Error Domain=NSPOSIXErrorDomain Code=28 "No space left on device"}} Then I write the following  code to log available space and found it is only 26.95 GB available not 180.38 GB as UI displayed NSError *error = nil; NSDictionary *dictionary = [[NSFileManager defaultManager] attributesOfFileSystemForPath:path error: &error]; NSNumber *sizeValue = [dictionary objectForKey:NSFileSystemFreeSize]; uint64_t totalFreeSpace = [sizeValue unsignedLongLongValue]; print(@“ %@ Free space available.", [NSByteCountFormatter stringFromByteCount:totalFreeSpace countStyle:NSByteCountFormatterCountStyleFile]); Does any one know what reason  may cause this strange situation and how can I do to make available space displayed in UI could be reliable? Any suggestion will be very appreciated!
4
2
1.2k
Mar ’24