Search results for

NSCocoaErrorDomain

1,063 results found

Post

Replies

Boosts

Views

Activity

How to safely create root and branch objects in a custom zone?
I encountered issues with some branch objects being assigned to multiple zones error (on iOS 17.5.1 and above). I get the errors when calling persistentContainer.shareshare(:to:completion:) and persistentContainer.persistUpdatedShare(:in:completion:). The operation couldn't be completed. Request '89D3F62D-548D-4816-9F1B-594390BD8F70' was aborted because the mirroring delegate never successfully initialized due to error: Error Domain=NSCocoaErrorDomain Code=134060 A Core Data error occurred. UserInfo={NSLocalizedFailureReason=Object graph corruption detected. Objects related to 'Oxa2255fdc1fa980c5 x-coredata://CB800FA2-6054-4D91-8EBC-E9E31890344F/CDChildObject/p588' are assigned to multiple zones: {l , In my setup, I moved all my root objects into one custom zone (there is only one custom zone in my private database). In one of my root object, there are 6 'one-to-one' and 2 'one-to-many' relationships. The branch objects can contains other relationships. Create root object flow: func saveToPersistent
2
0
610
Jul ’24
Security scoped bookmark and external drives
I'm writing a photo management app where the document stores the location of folders (in which image files reside). These are added by the user, and saved as security scoped bookmarks. All this appeared to be working. However, I tested a use-case where the user starts working on one machine where they add a folder, which resides on an external drive. This works, as long as they remain the on the same machine. However, if they move to another machine, plug in the external drive and then load up the document it fails to resolve the bookmark, throws the following error: Error Domain=NSCocoaErrorDomain Code=259 The file couldn’t be opened because it isn’t in the correct format. For completeness here is the code to resolve the bookmark: do { let url = try URL( resolvingBookmarkData: data, options: Self.bookmarkResolutionOptions, relativeTo: nil, bookmarkDataIsStale: &isStale ) } catch { print(error) /// ... error handling code here } Do I therefore assume that I cannot achieve this, and will have to a
1
0
1.3k
Nov ’22
CXProvider.reportNewIncomingVoIPPushPayload resulting in NSXPCConnectionInterrupted
We have just been granted access to the com.apple.developer.usernotifications.filtering entitlement, and are following the documented steps for handled E2EE VOIP notifications listed here: https://developer.apple.com/documentation/callkit/sending-end-to-end-encrypted-voip-calls 1 - A user initiates a VoIP call on their app. Their app then sends an encrypted VoIP call request to your server. We do exactly this, Alice calls Bob from her app, sending a notification to our servers. 2 - Your server sends the encrypted data to the receiver’s device using a regular remote notification. Be sure to set the apns-push-type header field to alert. We do exactly this, our server send on a notification to APNS with the apns-push-type header set to alert, destined for Bob. 3 - On the receiver’s device, the notification service extension processes the incoming notification and decrypts it. If it’s an incoming VoIP call, the extension calls reportNewIncomingVoIPPushPayload(_:completion:) to initiate the call. It then silences
1
0
516
Jan ’25
When accessing a compressed file in the iCloud Drive from the Files app, an error occurs.
I am trying to upload a ZIP file, created by compressing other files in iCloud Drive through the Files app, using UIDocumentPicker. However, errors like those described in Test 1 and Test 2 in the sample code are occurring. import UIKit class ViewController: UIViewController,UIDocumentPickerDelegate { override func viewDidLoad() { super.viewDidLoad() } @IBAction func openDocumentPicker(_ sender: Any) { // Test 1 // let documentPicker = UIDocumentPickerViewController(forOpeningContentTypes: [.item], asCopy: true) // When clicking the Open button, there is no response, and the following error occurs. /* Failed to copy the imported file into the local container ((null)) Tried to call delegate -documentBrowser:didPickDocumentURLs: with an empty array of items. This indicates the items failed to be prepared and materialized on disk: ( FPItem=(null) ) */ // Test 2 let documentPicker = UIDocumentPickerViewController(forOpeningContentTypes: [.item]) // When using the regular mode instead of the copy mode, // the Ope
Topic: UI Frameworks SubTopic: General
1
0
834
Jan ’25
Sharelink is bronken in ios 17.3
block of code used in aditionl to the errors shown below i cant not share an image along a message to whatsapp, it will only take the message, for it to take the picture the messahe must be removed. ShareLink(Share Status as image, item: renderedImage, subject:Text((itemDue.customerName) your order is ready), // message: Text(mesaage), // , preview: SharePreview(Order status, image: renderedImage) ) .foregroundStyle(.white) .padding(5) .frame(maxWidth: .infinity) .background( RoundedRectangle(cornerRadius: 15) .stroke(Color.white, lineWidth: 2) ) when sharelink is being use i get the errors must current ios version and xcode: 2024-02-01 17:27:48.792287-0500 Tailored[4866:1376699] [ProcessSuspension] 0x11d0218c0 - ProcessAssertion::acquireSync Failed to acquire RBS assertion 'WebProcess NearSuspended Assertion' for process with PID=4876, error: Error Domain=RBSServiceErrorDomain Code=1 target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit UserInfo={NSLocalizedFailureReason=
1
0
1.8k
Feb ’24
File Provider Extension trouble
Hi everyone, I am a beginner in iOS/Swift programming. I'm trying to develop a mobile application that allows to mount a network drive in the iphone Files application via the WebDav protocol. I saw on the internet that WebDav is no longer implemented in iOS because considered deprecated by apple. To accomplish this task, I decided to separate responsibilities as follows: Framework: WebDav (responsible for communication with the WebDav server) FileProviderExtension: FileBridge (Responsible for bridging the gap between the WebDav Framework and the iOS Files app) Main App I also have an AppGroup that includes the main application and the fileproviderextension Initially, to measure the feasibility and complexity of this task, I'd like to make a simplistic version that simply displays the files on my drive in the Files app, without necessarily being able to interact with them. FileProviderExtension.swift: import FileProvider import WebDav class FileProviderExtension: NSObject, NSFileProviderReplicatedExtension { p
1
0
1k
Jan ’25
FileManager.copyItem Permission Bug in iOS 18.1.1 with iCloud Shared Folders
Hi there, I've encountered a file permission bug in iOS 18.1.1 when using FileManager.default.copyItem(at:to:) to copy files from an iCloud shared folder to the app sandbox. This issue occurs under the following conditions: The source file resides in an iCloud shared folder. The iCloud shared folder is owned by another iCloud user and shared with read-only permissions. The app copies the file to its sandbox using the copyItem(at:to:) method. Observed Behavior: After copying the file to the app sandbox, the original file's read-only permissions are propagated to the copied file. This results in an inability to delete the copied file from the app sandbox, with the following error message: NSCocoaErrorDomain, Code 513: The file couldn’t be removed because you don’t have permission to access it. Steps to Reproduce: Access a shared iCloud folder owned by another user with read-only permissions. Copy a file from this folder to the app sandbox using FileManager.default.copyItem(at:to:). Attempt to delete th
11
0
767
Dec ’24
SimpleWatchConnectivity sample - TransferFile fails
When launching the SimpleWatchConnectivity sample in a simulator (iOS 18.2 + watchOS 11.2), almost all the functionality works, but TransferFile does not work. The error is the following: -[WCFileStorage persistOutgoingFileTransfer:] error serializing file transfer due to Error Domain=NSCocoaErrorDomain Code=4866 Caught exception during archival: This object may only be encoded by an NSXPCCoder. How can it be fixed or worked around?
1
0
560
Dec ’24
Swift file reading permission error on macOS sandbox
I'm trying to read the contents of a file on the filesystem in a macOS Swift app (Xcode 9 / Swift 4).I'm using the following snippet for it:let path = /my/path/string.txt let s = try! String(contentsOfFile: path) print(s)My problem is the following:1. This works in a Playground2. This works when I use the Command Line Tool macOS app template3. This terminates in a permission error when I use the Cocoa App macOS app templateThe permission error is the following:Fatal error: 'try!' expression unexpectedly raised an error: Error Domain=NSCocoaErrorDomain Code=257 The file data.txt couldn't be opened because you don't have permission to view it. UserInfo={NSFilePath=/my/path/data.txt, NSUnderlyingError=0x60c0000449b0 {Error Domain=NSPOSIXErrorDomain Code=1 Operation not permitted}}I guess it's related to sandboxing but I found no information about it.1. How can I read from the filesystem in a sandboxed app? I mean there are so many GUI apps which need an Open File dialog, it cannot be a realistic restric
9
0
28k
Dec ’24
Reply to FileManager.copyItem Permission Bug in iOS 18.1.1 with iCloud Shared Folders
After updating to iOS 18.2, the issue I’ve been experiencing remains unresolved. To ensure the issue wasn’t related to the temporary folder permissions, I took the following steps: Created a custom temporary folder inside the app’s existing temporary folder. Used the UIDocumentPickerViewController to import a file and copied it into the newly created custom temporary folder. Unfortunately, this approach did not resolve the problem. Even after successfully copying the file into the custom folder, I am still unable to delete it. You have to understand that when I import a file using the UIDocumentPickerController, I expect the provided API to enable me to successfully copy the returned file into the app sandbox in such a way that I am then able to delete it. This operation appears to work correctly. do { let securityScoped = sourceItemURL.startAccessingSecurityScopedResource() try FileManager.default.copyItem(at: sourceItemURL, to: temporaryItemURL) print(INFO: Source item copied to temporary directory successf
Topic: App & System Services SubTopic: Core OS Tags:
Dec ’24
Mergeable Library in XCTest with iOS on Mac Target: 3588 Error
I have an XCTest unit test that's running in an iOS host but with the My Mac (Designed For iPad) Target. Enabling mergeable libraries causes two errors: Symbol not found: _$s10Foundation3URLV9RVAPIPackE8isGCSURLSbvg And loading failed because of an error Error Domain=NSCocoaErrorDomain Code=3588 for the Test bundle because one of the frameworks that's supposed to be merged couldn't be loaded. Disabling mergeable libraries fixes it. It also works with mergeable libraries enabled but with a regular simulator target. So not sure if I'm missing something or if I need to disable mergeable libraries now:/
2
0
363
Dec ’24
Reply to Creating file bookmarks doesn't work anymore on macOS 15 Sequoia
[quote='815622022, floorish, /thread/764435?answerId=815622022#815622022, /profile/floorish'] I've received multiple confirmations that any of these solutions resolve the issue: Create a new user account (old account will stay bugged) Reset the macOS keychain for the (bugged) user account Update to 15.1+ [/quote] Thank you SO MUCH for this. I've spent a TON of time investigating why, after updating from Ventura to Sonoma, Final Cut Pro 11 was being so terribly SLOW ( mainly when opening libraries and when closing the app ), even though FCP 10.8.1 worked fine! A clue pointing me towards this thread popped up, when I tried to use HandBrake to transcode a video and have encountered the very same problems as in FCP. Handbrake's console listed the following: [09:30:49] macgui: Failed to create bookmark: Error Domain=NSCocoaErrorDomain Code=256 Failed to retrieve app-scope key UserInfo={NSDebugDescription=Failed to retrieve app-scope key} [09:30:49] macgui: Failed to create bookmark: Error Domain=NSCocoaErrorDomain
Topic: App & System Services SubTopic: Core OS Tags:
Dec ’24
'Save to Files' doesn't work with ShareLink with FileRepresentation
I want to use ShareLink+FileRepresentation to save a small text file to my iPhone with the steps below. Tap [Share...] to display the share sheet. This sheet contains [Save to Files]. Tap [Save to Files]. A black sheet is displayed, but it disappears instantly. In step 3, I was expecting a browser to be displayed to select the location where the file will be saved. But in fact, a black sheet appears, which quickly disappears. The implemented code is as follows. import SwiftUI @main struct SLSandboxApp: App { var body: some Scene { WindowGroup { let title = Text(File Output) let numListString = 123,456,789 let numListFileName = numlist.csv let tagListFile = TextFile(content: numListString, filename: numListFileName) ShareView(title: title, fileToShare: tagListFile, messageToPreview: numListFileName) } } } struct ShareView: View { let title: Text let fileToShare: TextFile let messageToPreview: String var body: some View { ShareLink(item: self.fileToShare, preview: SharePreview(self.messageToPreview)) } } struct
1
0
652
Oct ’24
SwiftData iCloud sync breaks after disabling and re-enabling iCloud
A fairly simple ModelContainer: var sharedModelContainer: ModelContainer = { let schema = Schema([ Model1.self, Model2.self, Model3.self ]) let modelConfiguration = ModelConfiguration(schema: schema, isStoredInMemoryOnly: false, cloudKitDatabase: .automatic) do { let container = try ModelContainer(for: schema, migrationPlan: MigrationPlan.self, configurations: [modelConfiguration]) return container } catch { fatalError(Error: Could not create ModelContainer: (error)) } }() After upgrading to macOS 15 and disabling/enabling iCloud for the app the sync stopped working on Mac. The steps: Go to System Settings > Apple Account > iCloud > Saved to iCloud > See all find the App and disable iCloud. After this synced items are removed from the app and some errors thrown in the console ('..unable to initialize without an iCloud account...') Re-enable the iCloud setting This error appears in the console: CoreData: error: CoreData+CloudKit: -[NSCloudKitMirroringDelegate resetAfterError:andKeepContainer:](612)
12
0
2.1k
Dec ’24
On-demand resources suddenly stopped working?
So yesterday I noticed that some of images in my app stopped appearing. All of them were placed in the on-demand resources, that is I've assigned tags to them. Up until yesterday they were working correctly but since then whenever I try to load the assets I get the error message saying: Error Domain=NSCocoaErrorDomain Code=4099 Connection invalidated to streaming unzip service. My code for loading the asset is pretty straightforward and it was working perfectly fine before: let resourceRequest = NSBundleResourceRequest(tags: [vinyl]) defer { resourceRequest.endAccessingResources() } do { if await !resourceRequest.conditionallyBeginAccessingResources() { try await resourceRequest.beginAccessingResources() } } catch { assertionFailure(Vinyl image was not available, error: (error)) } I'm obviously using it in asynchronous context, but the old method which used completion handler gives me the same error. Has anyone encountered this issue as well? I just updated my devices to iOS 15.5, maybe that update b
6
0
3.7k
Dec ’24