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!
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
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?
Hi, I’ve developed a photo app that includes a photo deletion feature.
Some users have reported encountering PHPhotosError.operationInterrupted (3301) when attempting to delete photos.
Initially, I suspected that some of the assets might have a sourceType of typeiTunesSynced, since the documentation notes that iTunes-synced assets cannot be edited or deleted.
However, after checking the logs, all of the assets involved are of typeUserLibrary.
Additionally, the user mentioned that some photos in the iPhone Photos do not show a delete button.
I’m unsure whether the absence of the delete button is related to the 3301 error.
I’d like to confirm the following:
Under what conditions does PHPhotosError.operationInterrupted (3301) occur, and how should it be handled?
Why do some photos in the iPhone Photos not show a delete button?
The code for deleting photos is as follows:
PHPhotoLibrary *library = [PHPhotoLibrary sharedPhotoLibrary];
[library performChanges:^{
PHFetchResult *assetsToBeDeleted = [PHAsset fetchAssetsWithLocalIdentifiers:delUrls options:nil];
if (assetsToBeDeleted) {
[PHAssetChangeRequest deleteAssets:assetsToBeDeleted];
}
} completionHandler:^(BOOL success, NSError *error) {