Search results for

NSCocoaErrorDomain

1,063 results found

Post

Replies

Boosts

Views

Activity

Reply to Unable to write to file system when building for My Mac (Designed for iPad)
Our app is unable to write to its own sandbox container on macOS when run via “My Mac (Designed for iPad)”. This is not an issue when the app runs on iPhone or on iPad. So, the one thing to understand here is that the sandbox enforcement system operates at a low enough level of the system that I can't really fail*, at least not in a broad, systemic way. That's particularly true of apps running compatibility mode, which are designed to operate with very limited access. *Putting that in more concrete terms, if the basic app sandbox configuration is broken in some large-scale way, then the entire system tends to fall apart. That dynamic makes large-scale problems hard to... miss. Because of that, the assumption I'd start with here isn't may app can't read/write its files, but is instead either: I'm trying to access the wrong place. Something external to my app is interfering with my app’s ability to function. Expanding on that second point, it's important to remember that macOS is FAR more flexible/configurable
Topic: App & System Services SubTopic: Core OS Tags:
Oct ’25
Reply to instantiated view controller displays for 1 second then segues to next view controller for no reason
Ok i'll try my best to re-explain, the nextVC (aka the correct vc) shows up for a split second with all the UI and everything meaning the view controller instantiation was successful but then it automatically segues to the DashboardVC (the vc I want users to goto after nextVC). I am aware I push the nextVC, I didn't mean to say segue, but when that vc loads for a split second you don't even have time to interact with it, it automatically segues to the DashboardVC. Here is what prints in the console when I finish authenticating: ocean@gmail.com School Name Saved! Algolia Search Client Swift: Default minimal log severity level is info. Change Logger.minLogServerityLevel value if you want to change it. 2021-04-19T14:03:59-0400 info com.algolia.InstantSearchCore : Default minimal log severity level is info. Change Logger.InstantSearchCore.minLogSeverityLevel value if you want to change it. Permission granted: true Notification settings: UNNotificationSettings: 0x13332fed0; authorizationStatus: Authorized, notific
Topic: Programming Languages SubTopic: Swift Tags:
Apr ’21
SwiftData not syncing to CloudKit
I have an app with SwiftData and CloudKit sync enabled, it was working fine but I recently noticed that the sync with CloudKit is not working anymore. All the changes are persisted locally just fine. When running in simulator (iOS 26/iPhone 17 Pro) I get the following error in the console: CoreData+CloudKit: -[NSCloudKitMirroringDelegate recoverFromError:](2317): - Attempting recovery from error: Error Domain=NSCocoaErrorDomain Code=134421 Export encountered an unhandled exception while analyzing history in the store. UserInfo={NSLocalizedFailureReason=Export encountered an unhandled exception while analyzing history in the store., NSUnderlyingException=-[NSEntityDescription objectID]: unrecognized selector sent to instance 0x60000351aec0} I already tried Reseting the environment back to production in CloudKit and Erasing all Contents and Settings in the simulator but I keep getting the same error. Is there something else I can do to fix this?
2
0
202
Oct ’25
UIApplicationLaunchOptionsURLKey not accessible
My didFinishLaunchingWithOptions method stores a filename from the UIApplicationLaunchOptionsURLKey and tries to open it.-(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{ NSURL* url = [launchOptions objectForKey:UIApplicationLaunchOptionsURLKey]; NSError* err; if ([url checkResourcesIsReachableAndReturnError:&err]) { ... }}For iOS 8 this code works fine. My application is launched because some other application selected open in to my application, but for iOS 9 this code doesn't work, and I geterr = NSCocoaErrorDomain : code 257 : The file 'XXX' couldn't be opened because you don't have permission to view it.The operation couldn't be completed. Operation not permitted!!Very important note!!: This only happens when my application was shut down while the user tried to open a file from another application. If it was not shut down, just minimized, everything behaves well.Please helpThanksNili
1
0
1.5k
Jul ’15
Add custom metadata to HKLiveWorkoutBuilder
I'm trying to sync workouts for which I have to add the HKMetadataKeySyncIdentifier and HKMetadataKeySyncVersion metadata keys to the workouts. I've tried calling the addMetadata method on HKLiveWorkoutBuilder but I receive this cryptic error: HKLiveWorkoutBuilder_DB2D [E6B9]: (#w0) Failed to restart task server after connection invalidation: Error Domain=NSCocoaErrorDomain Code=4099 The connection to service on pid 0 created from an endpoint was invalidated from this process. UserInfo={NSDebugDescription=The connection to service on pid 0 created from an endpoint was invalidated from this process.} Here's my code: backend = try! HKWorkoutSession(healthStore: healthStore, configuration: workoutConfiguration) builder = session?.associatedWorkoutBuilder() let metadata : NSDictionary = [ HKMetadataKeySyncIdentifier : match.syncIdentifier, HKMetadataKeySyncVersion: match.syncVersion ] builder.addMetadata(metadata as! [String : Any]) { (success, error) in ... } session.delegate = self builder.delegate = s
1
0
1.3k
Aug ’20
Using ContactAccessButton freezes the entire app
When using both the ContactsAccessButton demo project, as well as when implementing it in my own, the whole app freezes after entering a few characters and searching through contacts. I don't know if this is necessarily reproducable because it's probably related to the contacts in my contact book. Typing in Lex does not freeze the app, but typing in Adam No freezes it. I get the following console error before my app freezes and I'm forced to force quit it: #ContactsButton Failed to get service proxy: Error Domain=NSCocoaErrorDomain Code=4097 connection to service with pid 3387 named com.apple.ContactsUI.ContactsButtonXPCService UserInfo={NSDebugDescription=connection to service with pid 3387 named com.apple.ContactsUI.ContactsButtonXPCService} #ContactsButton Failed to get remote content: nil (got this a number of times ContactsAccessButton really doesn't seem production ready...
2
0
533
Sep ’24
Audio unit extension cannot load UI
I'm working on an iOS 9 audio unit extension at the moment, that works as intended for debug builds, however I have come across and error code that I can't seem to overcome. I'm hoping that someone else has come across this error and are able to offer any advice. The error I am getting only occurs on release builds distributed through either Crashlytics or the App Store (which, unfortunately, is how i first came across this error). Debugging through the Apple AUv3 demo gives the read out:Session <UUID> was unable to communicate with the remote service: Error Domain=NSCocoaErrorDomain Code=4099The connection to service named <bundleIndentifier>.viewservice was interrupted, but the message was sent over an additional proxy and therefore this proxy has become invalid.This message appears to be thrown when attempting to load the UI for the audio unit, however I am at a loss on how to progress from here.Any help or suggestions would be greatly appreciated,
0
0
615
Jan ’16
NSData(contentsOf:,options:) works on the simulator, but not on the device
What is wrong with NSData(contentsOf:,options:) on the device?On the Simulator, i can read the url and get the JSON content, but when i run on the actual Apple Watch, i get the following error:Error 3: Error Domain=NSCocoaErrorDomain Code=256 Could not open file “******”. UserInfo={NSURL=http://******}Here is my code:let url = NSURL(string: http://some.website) var mainArray: Array<Dictionary<String, AnyObject>> = [] do{ let data: Data = try Data(contentsOf: url!) let dictionary: Any? = try JSONSerialization.jsonObject(with: data as Data, options: JSONSerialization.ReadingOptions()) if let dictionary = dictionary as? Dictionary<String, AnyObject> { mainArray = dictionary[data] as! Array<Dictionary<String, AnyObject>> mainArray = mainArray.reversed() } else { print(Error 1: not a valid JSON) } } catch { print(Error 2: (error)) }I tried with URLSession and it works on the device, but it's sooooooo much slower.
3
0
2.3k
Oct ’16
macOS Catalina - Current bundle does not have a SystemExtensions directory
I've upgraded my macOS to Catalina. Then I tried to run via Xcode my macOS VPN app (implemented with Packet Tunnel Provider) -The VPN fails to connect and I see at the Console a lot of errors, such as:Current bundle (/Users/myClientPath/Client.app) does not have a SystemExtensions directoryNESMVPNSession[Primary Tunnel:myDetails:(null)]: Received a start command from myClient[2061]Found 0 (0 active) registrations for com.my.bundle.id.extension (com.apple.networkextension.packet-tunnel) - this msgs repeats several timesNEVPNTunnelPlugin(com.my.bundle.id[794]): Validation of the extension failedNESMVPNSession in state NESMVPNSessionStateStarting: plugin NEVPNTunnelPlugin started with PID 0 error (null)Hub connection error: Error Domain=NSCocoaErrorDomain Code=4097 connection to service on pid 0 named com.my.bundle.id.extensiondisposingFailed to start extension com.my.bundle.id.extensionNSDebugDescription=connection to service on pid 0 named com.my.bundle.id.extensionHow can I solve it?
5
0
1.5k
Dec ’19
Share Extension can access files from the Photos app but not the Files app
Share Extension can access files from the Photos app but not the Files app. In case of the Photos app the file url is something like file:///var/mobile/... In case of the Files app the url stars with file:///private/var/mobile/... The following error is thrown in case of the Files app Error Domain=NSCocoaErrorDomain Code=260 The file “file.pdf” couldn’t be opened because there is no such file. However the file is there, it was selected via the Files app and the share button was used to launch the Share Extension. Also the access to the file is within the following block url.startAccessingSecurityScopedResource() ... url.stopAccessingSecurityScopedResource() Another issue is that the Share Extension does not appear in the Settings / Privacy / Files and Folders. Here are the apps which have the Applications that have requested access to files and folders will appear here. What is the solution to allow the Share extension access the files from the Files app ?
0
0
728
Jan ’24
Permission error occurs when I use setDefaultApplication(at:toOpen:completion:)
I'd like to set my macOS app written in Swift as default app when opening .mp4 file. I think I can do it with setDefaultApplication(at:toOpen:completion:). https://developer.apple.com/documentation/appkit/nsworkspace/3753002-setdefaultapplication However, permission error occurs when I use it. The error is: Error Domain=NSCocoaErrorDomain Code=256 The file couldn’t be opened. UserInfo={NSUnderlyingError=0x6000031d0150 {Error Domain=NSOSStatusErrorDomain Code=-54 permErr: permissions error (on file open)}} I tried to give my app full-disk access, but it didn't work. I also tried to use setDefaultApplication(at:toOpenFileAt:completion:), then it works with no error, but it effects on only one file. What I want to do is to set my app as default app of all .mp4 files. How do I achieve this? My code is like below: let bundleUrl = Bundle.main.bundleURL NSWorkspace.shared.setDefaultApplication(at: bundleUrl, toOpen: .mpeg4Movie) { error in print(error) } Thank you.
3
0
587
Jun ’23
StoreKit 2.0 keep throwing unknown error.
After the release of StoreKit 2.0, the in-app purchase failure rate increased by 63.19%, with the majority of errors being StoreKitError.unknown. When encountering this error, many users repeatedly attempt to make a purchase, but the outcome remains unchanged, resulting in the same unknown error. In some cases, users who wait approximately 2 minutes before retrying the purchase may either succeed or encounter the following error: “StoreKit.StoreKitError.systemError(Error Domain=NSCocoaErrorDomain Code=4097 connection to service named com.apple.storekitd”)”. This issue has directly impacted our app's purchasing flow. Because our app only displays the promotional purchase offer once, these issues have significantly reduced the number of users successfully completing the offer. As a result, the conversion rate for this promotion has dropped well below expectations, negatively impacting our business metrics.
4
0
1.8k
Dec ’24
Core telephony error with Xcode 10
I upgraded our legacy app to use Blackberry Dynamics IOS SDK 5.0.0.63 to be compatible with Xcode 10.1. Even without calling on Blackberry APIs (by not using GD), I would get this error - The connection to service named com.apple.commcenter.coretelephony.xpc was invalidated.The app would work with Xcode 9.4 and Blackberry Dynamics IOS SDK 3.0.2.51. Good Dynamics (GD) was purchased by Blackberry.Is it because I have not completely upgraded the GD code that I am getting the telephony error - the app needs to have internet access for a web service call before showing a login screen and it is failing to resolve - Synchronous remote object proxy returned error: Error Domain=NSCocoaErrorDomain Code=4099 The connection to service named com.apple.commcenter.coretelephony.xpc was invalidated. UserInfo={NSDebugDescription=The connection to service named com.apple.commcenter.coretelephony.xpc was invalidated.Thank you.
0
0
2.7k
Dec ’18
Unable to get file handle when running code within Xcode
Hi All, I have the following code in swift to read and print a file's content: import Foundation let a = try String(contentsOfFile: /Users/humza/Desktop/test.txt) print(a) I am able to run the code in an Xcode playground. However, when I make a command line project in Xcode 11.4.1, I get the following error when running the project: Fatal error: Error raised at top level: Error Domain=NSCocoaErrorDomain Code=257 The file “test.txt” couldn’t be opened because you don’t have permission to view it. Note the build is successful and I can run the executable from terminal. What is preventing this from running within Xcode? I do not have a sandboxing capability added to my project. I have tried clearing the project's build folder. I have also given Xcode full disk access. I have also given my file full 777 permissions to help debug.
0
0
440
Jul ’20
How to send mail from app in background
I need to send a mail(s) in the background for my app. What is the best way of doing this? I have tried Mailgun, but hav not got it working. Any tips on what the best/easiest way to send mail in background? Here´s the code I was trying for Mailgun: let parameters = [ from: my@mail.com, to: you@mail.com, subject: Test, text: Testing] let header : HTTPHeaders = [ Authorization: MY-KEY, Content-Type : application/x-www-form-urlencoded] let url = MY-URL AF.request(url, method: .post, parameters: parameters, encoding: URLEncoding.default, headers: header) .responseJSON { response in print(Response: (response)) }This throws the following error:failure(Alamofire.AFError.responseSerializationFailed(reason: Alamofire.AFError.ResponseSerializationFailureReason.jsonSerializationFailed(error: Error Domain=NSCocoaErrorDomain Code=3840 Invalid value around character 0. UserInfo={NSDebugDescription=Invalid value around character 0.})))
1
0
929
Jan ’20