Hi. My MacOS application (Obj-C, Cocoa MacOS 10.15 or later) sets itself as delegate for UNNotificationCenter, and implements both - (void)userNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(UNNotificationPresentationOptions))completionHandler and - (void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(nonnull UNNotificationResponse *)response withCompletionHandler:(nonnull void (^)(void))completionHandler It creates and schedules many user-notifications (mostly with no trigger meaning - present to the user ASAP and sometimes 2.5 seconds in the future, so to group notifications better. Each notification is also holding som dictionary of UserInfo containing some data. My AppDelegates handles user responses (both standard open, cancellation, and cancel-all) and also custom user-actions I attach to the category. All works well on most Macs and almost always. However - On few Macs
Search results for
NSCocoaErrorDomain
1,063 results found
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
Hello,I have modified the AVCam sample found here: https://developer.apple.com/library/prerelease/content/samplecode/AVCam/Introduction/Intro.html to capture and save DNG files.When attempting to save the (valid) DNG usingPHAssetCreationRequest *creationRequest = [PHAssetCreationRequest creationRequestForAsset]; [creationRequest addResourceWithType:PHAssetResourceTypePhoto data:self.photoData options:nil];It fails with Error Domain=NSCocoaErrorDomain Code=-1 (null)Alternatively, if I try saving the DNG with:[[[ALAssetsLibrary alloc] init] writeImageDataToSavedPhotosAlbum:self.photoData metadata:nil completionBlock:^(NSURL *assetURL, NSError *error)]A .TIF file is saved to the Camera Roll. This photo cannot be displayed by the Camera Roll (it shows up, just shows up blank), but if I transfer that file to my computer and rename the extension to .DNG, the photo loads just fine.Is anyone else having these issues? Is there a better / correct way to save DNGs? Are they known bugs in iOS 10 beta 8?Thank you
We are using the PHPickerViewController to load photos and videos into our app. When an item was picked we load it using the loadFileRepresentation() method of NSItemProvider. In its callback we get the following error sometimes: Error copying file type public.movie. Error: Error Domain=NSItemProviderErrorDomain Code=-1000 Cannot load representation of type public.movie UserInfo={NSLocalizedDescription=Cannot load representation of type public.movie, NSUnderlyingError=0x281a87a50 {Error Domain=NSCocoaErrorDomain Code=4101 Couldn’t communicate with a helper application. UserInfo={NSUnderlyingError=0x281a85e30 {Error Domain=PHAssetExportRequestErrorDomain Code=0 (null) UserInfo={NSUnderlyingError=0x281a85620 {Error Domain=PFSharingRemakerErrorDomain Code=2 Underlying operation encountered an error UserInfo=0x280018500 (not displayed)}}}}}} The error seems to occur randomly when picking arbitrary videos. What does the error mean and how do we make the item provider load more reliably here?
Hello, I'm a newer Xcode developer trying to debug an error I'm getting in my iOS app. I'm using this code to get file content: //inputFile = here is my file name with no extension let filepath = Bundle.main.path(forResource: inputFile, ofType: txt) //filepath = /Users/username/Library/Developer/CoreSimulator/Devices/[DeviceGUID]/data/Containers/Bundle/Application/[AppGUID]/AppName.app/here is my file name with no extension.txt let fileContent = try String(contentsOfFile: filepath) That line generates a runtime error: error NSError domain: NSCocoaErrorDomain - code: 264 0x0000600000c74d20 Xcode 16.2 on macOS Sequoia 15.1.1 I had this code working... I had to step away from the code for a few months; I updated Xcode and now I'm getting this error. (I could've screwed the code up). I navigated to the directory and the file is there. Anybody have any ideas? Thank you! Hoss
I'm trying to convert a watchOS 1 app to watchOS 2.But I saw an error when trying to load an image from an URL with this code: let url:NSURL = NSURL(string: http://www.xxxxxxxx.com/xxx/xyz.jpg)! let data:NSData = try! NSData(contentsOfURL:url, options:[]) imageone.setImage(UIImage(data: data))The error is:> Error Domain=NSCocoaErrorDomain Code=256 The file “xyz.jpg” couldn’t be opened. UserInfo={NSURL=http://www.xxxxxxxx.com/xxx/xyz.jpg}I read on the internet that is because of the new Application Transport Security protocol.I also read to put <key>NSAppTransportSecurity</key> <dict> <key>NSAllowsArbitraryLoads</key> <true/> </dict>in the info.plist on the Watchkit extension but the same error appear.It's the same also if I use an image in an HTTPS domain.NOTE: On the simulator it works perfectly!I'm using XCode 7 beta 5.Anyone knows how to solve?Thanks
This project writes with Objective-C, it can build succeeded, but not run. It will show Details The file “Service Reports” couldn’t be opened because you don’t have permission to view it. Domain: NSCocoaErrorDomain Code: 257 Failure Reason: You don’t have permission. Recovery Suggestion: To view or change permissions, select the item in the Finder and choose File > Get Info. User Info: { NSFilePath = /Users/USERNAME/Desktop/ServiceReportApp64Bit/DerivedData/Service Reports/Build/Products/Debug-iphonesimulator/Service Reports.app; }- The operation couldn’t be completed. Permission denied Domain: NSPOSIXErrorDomain Code: 13 Failure Reason: Permission denied-. I checked the FilePath provieded, the .app file displays with a white circle/slash over the icon. And when I double click this file it will show You can't open the application Service Report because it may be damaged or incomplete. Any idea guys? Thanks
I'm trying to open a file for writing. I can get the URL but the FileHandle always comes back nil. Any idea why this won't work?let fileURL = try FileManager.default.url(for: .documentDirectory, in: .userDomainMask, appropriateFor: nil, create: false).appendingPathComponent(test.tag) let file: FileHandle? = try FileHandle(forWritingTo: fileURL)file always comes back as nil. I get this error:Error Domain=NSCocoaErrorDomain Code=4 The file “test.tag” doesn’t exist. UserInfo={NSFilePath=/var/mobile/Containers/Data/Application/0D688141-D9C2-4CD0-849F-A2CBC69E34CD/Documents/test.tag, NSUnderlyingError=0x1c465d760 {Error Domain=NSPOSIXErrorDomain Code=2 No such file or directory}}Isn't the FileHandle call supposed to create the file? How else do you do it? The only other create file I can find is one that creates a file when you already have the complete contents to provide at the start, and I don't.Thanks!
I'm getting a sandbox_extension_issue_file error [1: Operation not permitted] from ScopedBookmarkAgent while trying to resolve a successfully created security-scoped bookmark via URL(resolvingBookmarkData:options:relativeTo:bookmarkDataIsStale:) which then produces the error Error Domain=NSCocoaErrorDomain Code=256 Couldn't issue sandbox extension for the resolved URL The error only occurs for files under a dedicated folder /System/Volumes/Data/Test and not for files and folders under, e.g., /Users/... From what I understand, everything at /System/Volumes/Data/ and below should be accessible for the user. I've made sure that the Test folder has read and write permissions for the current user and changed ownership of the folder to username:staff, where username denotes my local user name. This happens both under macOS Big Sur 11.6.2 and macOS Monterey 12.1. Any help is much appreciated!
I have be trying to use the sample code project associated with WWDC21 session 10294: Meet MusicKit for Swift, with Catalyst. The apps works on mac correctly excepted the playback and the barcode scanning (that is out of my scope) The following message is displayed continuously: MusicAlbums[30849:533531] [SDKPlayback] Failed to obtain synchronousRemoteObject: Error Domain=NSCocoaErrorDomain Code=4099 The connection to service named com.apple.Music.MPMusicPlayerApplicationControllerInternal was invalidated: failed at lookup with error 3 - No such process. UserInfo={NSDebugDescription=The connection to service named com.apple.Music.MPMusicPlayerApplicationControllerInternal was invalidated: failed at lookup with error 3 - No such process.} Before diving deeper i wanted to know if some of you have been able to play music via MusicKit with Mac catalyst? The sample code uses an ApplicationMusicPlayer.shared that is not available directly on macOS. (In fact none of the Music players are available) Would yo
@Generable enum Breakfast { case waffles case pancakes case bagels case eggs } do { let session = LanguageModelSession() let userInput = I want something sweet. let prompt = Pick the ideal breakfast for request: (userInput) let response = try await session.respond(to: prompt,generating: Breakfast.self) print(response.content) } catch let error { print(error) } i want to test the @Generable demo but get error with below:decodingFailure(FoundationModels.LanguageModelSession.GenerationError.Context(debugDescription: Failed to convert text into into GeneratedContentnText: waffles, underlyingErrors: [Swift.DecodingError.dataCorrupted(Swift.DecodingError.Context(codingPath: [], debugDescription: The given data was not valid JSON., underlyingError: Optional(Error Domain=NSCocoaErrorDomain Code=3840 Unexpected character 'w' around line 1, column 1. UserInfo={NSJSONSerializationErrorIndex=0, NSDebugDescription=Unexpected character 'w' around line 1, column 1.})))]))
Topic:
Machine Learning & AI
SubTopic:
Foundation Models
Hello Apple Developer Community, I'm encountering an issue with my macOS application where I'm receiving the following error message: Error Domain=NSCocoaErrorDomain Code=4099 The connection to service named com.FxPlugTestXPC was invalidated: failed at lookup with error 159 - Sandbox restriction. UserInfo={NSDebugDescription=The connection to service named com.FxPlugTestXPC was invalidated: failed at lookup with error 159 - Sandbox restriction.} This error occurs when my application tries to establish a connection to an XPC service named com.FxPlugTestXPC. It appears to be related to a sandbox restriction, but I'm unsure how to resolve it. I've checked the sandboxing entitlements and ensured that the necessary permissions are in place. However, the issue persists. Has anyone encountered a similar error before? If so, could you please provide guidance on how to troubleshoot and resolve this issue? Any help or insights would be greatly appreciated. Thank you. this is some photos about my entitlements :
Topic:
App & System Services
SubTopic:
Processes & Concurrency
Tags:
XPC
Objective-C
App Sandbox
Professional Video Applications
I’m converting a MusicKit app from iOS to macOS with Catalyst but can’t get the player to work. The app works flawlessly on iOS but I get the following error in my console on macOS whenever the MPMusicPlayer tries to manipulate the queue by adding a song with a store id [SDKPlayback] Failed to obtain remoteObject: Error Domain=NSCocoaErrorDomain Code=4099 The connection to service on pid 0 named com.apple.Music.MPMusicPlayerApplicationControllerInternal was invalidated. UserInfo={NSDebugDescription=The connection to service on pid 0 named com.apple.Music.MPMusicPlayerApplicationControllerInternal was invalidated.} Both the player, setQueue and play methods are according to the documentation supported on Mac Catalyst 13+: https://developer.apple.com/documentation/mediaplayer/mpmusicplayercontroller https://developer.apple.com/documentation/mediaplayer/mpmusicplayercontroller/1624253-setqueue https://developer.apple.com/documentation/mediaplayer/mpmusicplayercontroller/2582424-preparetoplay https://dev
I'm porting an iOS application on tvOS. It uses coredata.I copied the data management logic with no changes and in the simulator is working fine.When I attempt to run on real AppleTV I got this error but the application could continue to run and the Sqlite database is working (in readOnly). When I make any change and save the context I have a crash.Instead, as I told before, in the simulator everything seems working correctly.============================2015-09-27 02:31:19.571 Vda3dATV[207:9404] CoreData: error: -addPersistentStoreWithType:SQLite configuration:(null) URL:file:///var/mobile/Containers/Data/Application/6BA4E327-F24E-4E84-ACBE-4C2F33627108/Documents/QuickAround.sqlite options:{ NSInferMappingModelAutomaticallyOption = 1; NSMigratePersistentStoresAutomaticallyOption = 1;} ... returned error Error Domain=NSCocoaErrorDomain Code=512 The file couldn’t be saved. UserInfo={reason=Failed to create file; code = 1} with userInfo dictionary { reason = Failed to create file; code = 1;}============
Hello,below is our code block used in our app to connect to web service. Our app worked fine in iOS9. But users upgraded to iOS10, the app failed to connect to the web service.data on line 8 returns nil.error returns domain:@NSCocoaErrorDomain -code:256the url we use in this format: https://xxx.xxx.com/xxiOSService/partFinder.svc/GetLogin/ID=2451789487any idea why it only fails in iOS10?thank you!1) NSSTRING *_login = badgeTxt.text;2) NSSTRING *lab = [NSString stringWithFormat:@%@, _login];3) NSSTRING *filepath = [WcfServiceURL1 absoluteString];4) NSSTRING *test = [URL stringByAppendingString:filePath];5) NSSTRING *GetURL1 = [test stringByAppendingString:lab];6) NSURL *url = [NSURL URLWithString:GetURL1];7) NSError *error = nil;8) NSData *data = [NSData dataWithContentsOfURL: url options:NSDataReadingUncached error:&9) error];10) if (!error)11) {12) NSDictionary* json = [NSJSONSerialization13) JSONObjectWithData:data14) options:NSJSONReadingMutableContainers 15) error:&error];
Yesterday I had issues with my CoreData database for my Multiplatform app which resulted in changes to the schema. I reset the CloudKit version and, on the iOS simulator, had to delete my app and run the code again to get it to work. My issue is with the macOS target. I'm getting the same fatalError (Fatal error: Unresolved error Error Domain=NSCocoaErrorDomain Code=134140 Persistent store migration failed, missing mapping model.) when running the macOS app but I can't figure out how to delete it so I can run it fresh like I did with the iOS version. I've found where the application is created (in the Debug directory ultimately within my app's Build directory) and removed them all but when run the newly created application has the same error. Should I move up the directory structure and remove the entire app directory within Xcode/DerivedData or is there another way? Wanted an answer before I do something I can't go back from :) Thanks, Kyra