Running a MacOS Intel app from XCode 14.1, trying to access the user’s home folders, in this case, the ~/Downloads folder. I get directoryEnumerator error at file:///Users/maurice/Library/Containers/com.utilitybeltsoftware.icloudstatus2/Data/Downloads/: Error Domain=NSCocoaErrorDomain Code=256 The file “Downloads” couldn’t be opened. UserInfo={NSURL=file:///Users/maurice/Library/Containers/com.utilitybeltsoftware.icloudstatus2/Data/Downloads/, NSFilePath=/Users/maurice/Library/Containers/com.utilitybeltsoftware.icloudstatus2/Data/Downloads, NSUnderlyingError=0x6000011b2880 {Error Domain=NSPOSIXErrorDomain Code=20 Not a directory}} If I cd to this location, I do get access to the ~/Downloads folder, so the error is not telling the truth. Here is my entitlements plist <?xml version=1.0 encoding=UTF-8?> <!DOCTYPE plist PUBLIC -//Apple//DTD PLIST 1.0//EN http://www.apple.com/DTDs/PropertyList-1.0.dtd> <plist version=1.0> <dict> <key>com.apple.security.app-sandbox</key>
Search results for
NSCocoaErrorDomain
1,063 results found
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
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
Hey All, i am getting this error, when i try to pic a picture from library and camera with the help of UIImagePickerController. Anyone have any solution for this? **2022-11-22 12:17:56.241155+0530 ---[10745:2313612] [core] Error returned from daemon: Error Domain=com.apple.accounts Code=7 (null) 2022-11-22 12:17:56.245411+0530 ---[10745:2313614] [PAAccessLogger] Failed to log access with error: access= accessor:<> identifier:---kind:intervalEvent timestampAdjustment:0 visibilityState:0 assetIdentifierCount:0 tccService:kTCCServicePhotos, error=Error Domain=NSCocoaErrorDomain Code=4097 connection to service with pid 7261 named com.apple.privacyaccountingd UserInfo={NSDebugDescription=connection to service with pid 7261 named com.apple.privacyaccountingd}**
Background: I've used Xcode 11.3 for years with my 2015 macbook pro running OS 10.14.6. About a week ago, I thought I had to solve a problem by updating OS. Under that OS, 12.x, I installed the newest Xcode. This ended up not being the right solution, and caused other issues, so I switched back to 10.14.6. After the switch-back, I had to also delete that newer Xcode, and re-download Xcode 11.3. Now, it will not open at all, and I get a popup that says Loading a plug-in failed The plug-in or one of its prerequisite plug-ins may be missing or damaged and may need to be reinstalled. I try opening via Terminal and this is the printout: $ /Applications/Xcode.app/Contents/MacOS/Xcode ; exit; then some warnings that I suspect are not the problem, then the errors: 2022-11-12 19:58:27.335 Xcode[1562:20866] [MT] DVTPlugInLoading: Failed to load code for plug-in com.apple.dt.dbg.DebuggerFoundation (/Applications/Xcode.app/Contents/PlugIns/DebuggerFoundation.ideplugin), error = Error Domain=NSCocoaErrorDomain Co
Hello! I crated the support incident and today as I was trying again and I realized my app was sandbox. After dealing with that this is what I have: let service = daemonConnection.remoteObjectProxyWithErrorHandler { err in print(Received error: (err.localizedDescription)) } as? MyServiceProtocol which prints: Received error: Couldn’t communicate with a helper application. or Received error: Error Domain=NSCocoaErrorDomain Code=4097 connection to service named com.serviceName UserInfo={NSDebugDescription=connection to service named com.serviceName }
Topic:
App & System Services
SubTopic:
Core OS
Tags:
my bad i forgot my code : import Foundation import UIKit protocol HomeModelDelegate { func itemsDowloaded(client:[Client] ) } class HomeModel : NSObject { var delegate:HomeModelDelegate? func getItems(){ //Hit the conn url let serviceURL = http://myFTPSERVER/service.php //Download the JSON Data let url = URL(string: serviceURL) if let url = url { // Create a URL Session let session = URLSession(configuration: .default) let task = session.dataTask(with: url) { (data, url, error) in if let data = data { //Succed print(data) //call the parseJson self.parseJson(data) }else{ } } // Start the task task.resume() } //notify the view controller and pass the data back } func parseJson(_ data:Data){ var clientArray = [Client]() do { //Parse the data into Client structs let jsonArray = try JSONSerialization.jsonObject(with: data, options: []) as! [Any] print(jsonArray) //loop through each result in the json array for jsonResult in jsonArray { //Cast json result as a dictionary let jsonDict = jsonResult as! [String:String
Topic:
Programming Languages
SubTopic:
Swift
Tags:
Hello, I have a problem when I launch the application I have this error displayed in the log of the swift: Error Domain=NSCocoaErrorDomain Code=3840 JSON text did not have any content around line 2, column 0. UserInfo={NSDebugDescription=JSON text did not have any content around line 2, column 0., NSJSONSerializationErrorIndex=1} here is the php : set_charset(utf8mb4); // Check connection if (mysqli_connect_errno()) { echo Failed to connect to MySQL: . mysqli_connect_error(); } // This SQL statement selects ALL from the table 'Locations' $sql = SELECT `id`,`nom`,`prenom`,`tel`,`email`,`mdp`,`adr`,`cp`,`ville` FROM clients; // Check if there are results if ($result = mysqli_query($con, $sql)) { // If so, then create a results array and a temporary one // to hold the data $resultArray = array(); $tempArray = array(); // Loop through each row in the result set while($row = $result->fetch_object()) { // Add each row into our results array $tempArray = $row; array_push($resultArray, $tempArray); } //
Hello! I found that on the latest macOS 13 Ventura, my iOS app (iOS-App-On-Mac-With-M1/M2-Chip) is not able to restore IAP purchases or refresh receipt anymore. When using SKReceiptRefreshRequest() to refresh the IAP receipt, I got following error. Error Domain=SKErrorDomain Code=0 An unknown error occurred UserInfo={ NSLocalizedDescription=An unknown error occurred, NSUnderlyingError=0x1330c1840 { Error Domain=ASDErrorDomain Code=500 (null) UserInfo={ NSUnderlyingError=0x13338ebf0 { Error Domain=NSCocoaErrorDomain Code=513 You don’t have permission to save the file “receipt” in the folder “StoreKit”. UserInfo={ NSFilePath=/Users/***/Library/Containers/EC7E888F-3388-418A-92C5-9CBDDC4A1846/Data/StoreKit/receipt, NSUnderlyingError=0x13333a790 { Error Domain=NSPOSIXErrorDomain Code=1 Operation not permitted } } } } } } It seems that the receipt cannot be refreshed due to a file permission issue. Also, the SKPaymentQueue.default().restoreCompletedTransactions() function does not get the purchases properl
I am Trying to Create Carkey Remote Control session Using Apple's Carkey Library, I have the required entitlements from MIFI program that apple requires, Still whenever I try to Create A Remote Control Session I am Getting Sandbox Restriction Error, Please Help the Exact Error is [default] Failed to get proxy Error Domain=NSCocoaErrorDomain Code=4099 The connection to service named com.apple.seserviced.session was invalidated: failed at lookup with error 159 - Sandbox restriction. UserInfo={NSDebugDescription=The connection to service named com.apple.seserviced.session was invalidated: failed at lookup with error 159 - Sandbox restriction.} [default] Session ended before it started can anyone please help me understand what this error means.
Following the advice here: https://developer.apple.com/documentation/gamekit/enabling_and_configuring_game_center I tried allowing incoming connections in addition to outgoing connections but it doesn't help. I get this error: Could not get services from gamed. Please file a radar including GameKit logs, and any gamed crash logs. ERROR Error Domain=NSCocoaErrorDomain Code=4099 The connection to service named com.apple.gamed was invalidated: failed at lookup with error 159 - Sandbox restriction. UserInfo={NSDebugDescription=The connection to service named com.apple.gamed was invalidated: failed at lookup with error 159 - Sandbox restriction.} This happens on macOS 12.6.1. What am I doing wrong? Is there a workaround?
Sorry for my negative question ;-) Sorry for using a language where there’s no way to answer negative questions reliably (-: When launching the tests for the first time, I get the prompt for the Tester app to access Removable volumes. Right, because in that case you’re running your unit test within the Tester app. This is controlled by the Host Application popup in the General tab of your test target. If it’s set to None, the tests run in the Xcode test runner (in this caes, xctest). I did run my tests in Xcode. OK. To continue the story from yesterday, I opened my Package.swift file in Xcode and ran my tests. The test failed with: …/Tests/TestTests/TestTests.swift:8: error: -[TestTests.TestTests testExample] : failed: caught error: Error Domain=NSCocoaErrorDomain Code=257 The file “test.txt” couldn’t be opened because you don’t have permission to view it. UserInfo={NSFilePath=/Volumes/TCCTestRemovable/test.txt, NSUnderlyingError=0x600000c09f80 {Error Domain=NSPOSIXErrorDomain Code=1 Operation not pe
Topic:
App & System Services
SubTopic:
Core OS
Tags:
I try to using the module UserNotifications in swift project, to send notifications of my macos app. I pack my app with nested bundle like: /Application/MyApp.app - Contents - Resources - Frameworks - MacOS - my_binary - Notifier.app - Resources - Frameworks - Contents - MacOS - notifier_binary When I use cmdline to execute my notifier_binary, it's work fine. But when I execute it form my_binary, it will failed sometimes in api requestAuthorization, and the auth setting result will be not authed. But in current user's setting, it had been allowed. The error message in log, I can't find anything useful in google result, I have no idea what this error message means. 2022-10-27 16:32:11.297912+0800 0x3ded Error 0x0 1697 0 notifier_binary: (UserNotifications) [com.apple.UserNotifications:Connections] [com.my.notifier] Getting notification settings failed with error: Error Domain=NSCocoaErrorDomain Code=4099 The connection to service named com.apple.usernotifications.usernotificationservice was invalidate
Topic:
Programming Languages
SubTopic:
Swift
Tags:
Entitlements
Swift
Notification Center
User Notifications
Isn’t that the expected outcome? Oooo, negative questions are hard to answer in English (-: I ran a quick test of a regular app on macOS 13. Granting Full Disk Access to the app avoids the need for Files and Folders > Removable Volume. So this problem is somehow related to xctest. I then retried using a Swift package. Specifically, I created a simple package: % swift package init and modified the test like so: % cat Tests/TestTests/TestTests.swift import XCTest @testable import Test final class TestTests: XCTestCase { func testExample() throws { let url = URL(fileURLWithPath: /Volumes/TCCTestRemovable/test.txt) let d = try Data(contentsOf: url) print(count:, d.count) } } where TCCTestRemovable is a removable volume. Running this test from Terminal works: % swift test … count: 14 That’s because Terminal on my Mac has the Files and Folders > Removable Volumes privilege. In TCC parlance, Terminal in the responsible code for any programs you run from the shell. If I remove that privilege, the test fails: %
Topic:
App & System Services
SubTopic:
Core OS
Tags:
I am trying to understand the concepts between two of the CloudKit code samples: CoreDataCloudKitDemo, which shows sync between CoreData and CloudKit CoreDataFetchedProperty which shows how you can keep public and private data in two CoreData configurations and join them together. After some trial and error I created a single NSPersistentCloudKitContainer that I thought used the two separate configurations - each had it's own local persistent store, database scope was set properly for both stores, etc. But when I run the app it complained of the following: Failed to load persistent stores:Error Domain=NSCocoaErrorDomain Code=134060 A Core Data error occurred. UserInfo={NSLocalizedFailureReason=CloudKit integration does not allow relationships to objects that aren't sync'd. The following relationships have destination entities that not in the specified configuration. EntityA: entityB - EntityB So, I went back to the model and although I had created two separate Configurations (with EntityA in one and
Hi. I've been struggling with this for quite sometime, and none of the solutions here or on StackOverflow work for me. In the app's Documents directory I create an images folder, and inside it there are many other folders and each one contains images. I do have permissions to create and read each folder and image, but I can't delete them. I get the following error: Error Domain=NSCocoaErrorDomain Code=513 “Front” couldn’t be removed because you don’t have permission to access it. UserInfo={NSUserStringVariant=(Remove), NSFilePath=/var/mobile/Containers/Data/Application/643B50DD-8696-4C5D-9EC2-106AFE317B8B/Documents/horseImages/54da3ac3-bdbc-4670-a848-b507abf5fcc0/Front, NSUnderlyingError=0x280e12a00 {Error Domain=NSPOSIXErrorDomain Code=1 Operation not permitted}} I create the folders like this: try fileManager.createDirectory(at: imagesUrl, withIntermediateDirectories: true, attributes: [:]) but I also tried setting the attributes as nil, and also giving the .posixPermissions key a 777 value. The wa