Hello everybody. I am trying to save a new contact in the contact book. But I get an error in the catch block: Domain=NSCocoaErrorDomain Code=134092 “(null)”. This error only appears on Mac 13.1 Ventura. Everything works fine on iOS and MacOS 14.2.1 Sonoma. What could be the problem? func save(_ cnContact: CNMutableContact, identifier: String? = nil) throws { let saveRequest = CNSaveRequest() saveRequest.add(cnContact, toContainerWithIdentifier: identifier) do { try CNContactStore().execute(saveRequest) } catch { print(error) } }
Search results for
NSCocoaErrorDomain
1,063 results found
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
Afternoon all, I am starting out and want to store data in the App, some will be user specific and some general. So I have a new developer account which should have CloudKit permissions. I am just trying to make any of the most basic example applications work, but keep hitting issues. I create an App, select CloudKit and SwiftData. When I go into the signing and capabilities I select the Team which has the developer account. Then the CloudKit is selected as I clicked it when creating the project, but no Container is selected. I create a Container using the +, it names it iCloud.com.mydomain.AppName. However it is coloured in Red text. I press the refresh and then it turns into black text, the Push Notifications appear all populated for 1 second then all disappear. I have nothing under Push now, only a Trashcan button. The Container is now selected however. Is this an issue that the Push notifications items appeared then vanished? When I then try to run the app, using any of the many attempts I have had with s
We had a few users reporting this issue where our app is unable to connect to StoreKit. Failed product request from the App Store server: systemError(Error Domain=NSCocoaErrorDomain Code=4097 connection to service named com.apple.storekitagent UserInfo={NSDebugDescription=connection to service named com.apple.storekitagent}) This occurs when calling Product.products(for:). Some users mentioned they had to restart their Mac in safe mode to make the error go away, some had DNS cache issues and clearing those helped, or some found the culprit to be Adguard. What could be causing this error as it is not very clear what's causing it?
Even with sample code from Apple, the same warning forever. Error returned from daemon: Error Domain=com.apple.accounts Code=7 (null) Failed to log access with error: access= accessor:<> identifier:2EE1A54C-344A-40AB-9328-3F8E8B5E8A85 kind:intervalEvent timestampAdjustment:0 visibilityState:0 assetIdentifierCount:0 tccService:kTCCServicePhotos, error=Error Domain=NSCocoaErrorDomain Code=4097 connection to service with pid 235 named com.apple.privacyaccountingd UserInfo={NSDebugDescription=connection to service with pid 235 named com.apple.privacyaccountingd} Entitlements are reviewed.
I tried to archive a NSDictionary with a NSColor : data = [NSKeyedArchiver archivedDataWithRootObject: <vrRoot> requiringSecureCoding:YES error:&error]; and I get this error : Printing description of error: Error Domain=NSCocoaErrorDomain Code=4864 value for key 'NS.objects' was of unexpected class 'NSColor' (0x7ff8465d0d88) [/System/Library/Frameworks/AppKit.framework]. Allowed classes are: {( 'NSMutableDictionary' (0x7ff8465f9b48) [/System/Library/Frameworks/CoreFoundation.framework] )} UserInfo={NSDebugDescription=value for key 'NS.objects' was of unexpected class 'NSColor' (0x7ff8465d0d88) [/System/Library/Frameworks/AppKit.framework]. Allowed classes are: {( 'NSMutableDictionary' (0x7ff8465f9b48) [/System/Library/Frameworks/CoreFoundation.framework] )}} Then I transferred NSColor to NSArray - but the error was the same. I want data save in Core Data, please help me ♡.
OS Version: macOS Sonoma 14.2 Xcode Version: 15.0 Im getting this log errors while launching my app: Updating selectors failed with: Error Domain=NSCocoaErrorDomain Code=4099 The connection to service named com.apple.commcenter.coretelephony.xpc was invalidated: failed at lookup with error 3 - No such process. UserInfo={NSDebugDescription=The connection to service named com.apple.commcenter.coretelephony.xpc was invalidated: failed at lookup with error 3 - No such process.} Synchronous remote object proxy returned error: Error Domain=NSCocoaErrorDomain Code=4099 The connection to service named com.apple.commcenter.coretelephony.xpc was invalidated: failed at lookup with error 3 - No such process. UserInfo={NSDebugDescription=The connection to service named com.apple.commcenter.coretelephony.xpc was invalidated: failed at lookup with error 3 - No such process.} Updating selectors failed with: Error Domain=NSCocoaErrorDomain Code=4099 The connection to service named com.apple.commcent
I'm currently developing a custom keyboard which bundled with main app. The keyboard would randomly crash when switch between apps with opened custom keyboard on physical device. I've read posts around but seems not what I've encountered. Bundle ID of main app: com.company.appName Bundle ID of keyboard extension: com.company.appName.Keyboard When custom keyboard is opened second time on other app, a sole personality warning would show up, but this won't lead to crash. WARNING! Sole personality is ambiguous; this may lead to erratic behavior [lifecycle] [u 9A2D7B1D-20AF-4E2A-A72F-C37C8D4FDEEA] [com.company.appName.Keyboard(1.0.0)] WARNING! Sole personality is ambiguous; this may lead to erratic behavior; personalities: { com.companyName.appName.keyboard = { 19209 = <PKServicePersonality: 0x28299da00; core = <[u 9A2D7B1D-20AF-4E2A-A72F-C37C8D4FDEEA] [com.company.appName.Keyboard(1.0.0)],[d (null)] [/private/var/containers/Bundle/Application/67892ACC-5BDA-4205-828D-4D94D6E87ABD/AppName.app/PlugIns/Keyboard
I have v3 models in coredata (model: Event, Lecture), and make new model in v4 with swiftdata but model name, property is different (model: EventModel, LectureModel). For migration, I add V3Schema, V4Schema and MigrationPlan. enum V4Schema: VersionedSchema { static var models: [any PersistentModel.Type] = [LectureModel.self, EventModel.self ] static var versionIdentifier = Schema.Version(4, 0, 0) } enum V3Schema: VersionedSchema { static var models: [any PersistentModel.Type] = [Event.self, Lecture.self] static var versionIdentifier = Schema.Version(3, 5, 2) } enum ModelMigrationPlan: SchemaMigrationPlan { static var schemas: [any VersionedSchema.Type] = [V3Schema.self, V4Schema.self] static var stages: [MigrationStage] = [migrateV3ToV4] } extension ModelMigrationPlan { static let migrateV3ToV4 = MigrationStage.custom(fromVersion: V3Schema.self, toVersion: V4Schema.self, willMigrate: willMigrate, didMigrate: { _ in Log.debug(message: Migration Complete) }) } private func willMigrate(context: ModelContext) thr
Oh blah, I shoulda scrolled down )-: The above is my response to your first post. The following is in response to your subsequent ones. I'm sorry I already tried to shorten it up - and failed :-D Thank you for reading through! The former approach only works when you’re installing the agent yourself, because you control the entire launchd property list. Use the latter approach if you’re using SMAppService to install your agent. I was actually using SMAppService.agent(plistName: )the whole time, I just took the information about the Bundle Identifier in AppSandboxLoginItemXPCDemo because I couldn't make the way with just the groups work. That was what I originally tried but never worked and I thought this is the way to do it. Or am I using this wrong? I'm copying the plist file with a build phase to Destination Wrapper into Contents/Library/LaunchAgents. This is the SMAppService way or do I have to do something different? Or is this mixed way between AppService and LoginItem? instead of using a command line tar
Topic:
Code Signing
SubTopic:
General
Tags:
Well - I think I found my problem and wow it's a weird one. After reading all the sample code related to XPC again and adding my teamID again to the bundle identifier (XXXXXXXXX.com.myapp.helper) I saw Xcode replacing the first character of the teamID with a dash - It always did that and I put that to Xcode weirdness Because bundle Identifiers are reverse dns format this should obviously not start with a digit - well unlucky situation here Well now this is a problem. My TeamIdentifier starts with a 4. My bundleID 4T9XXXXXX.com.myapp.helper gets immediately after submitting the textfield replaced with -T9XXXXXX.com.myapp.helper. When I build the App and check its contents Info.plist - the bundleidentifer is the wrong one with a dash. I think this took me all over the place because I ignored it for year when I saw it. After setting the Product Name and bundle Identifiers manually, it took some tries of changing the plist but after some tries it did stick. after reviewing again AppSandboxLoginitemXPCDemo readme
Topic:
Code Signing
SubTopic:
General
Tags:
I create a new project just for testing on-demand resources and it works properly on real devices and iOS simulators but no luck on Mac(Designed for iPad). The project is very simple like bellow: NSBundleResourceRequest* request = [[NSBundleResourceRequest alloc] initWithTags:[NSSet setWithArray:@[@A]]]; [request beginAccessingResourcesWithCompletionHandler:^(NSError* error){ if (error != nil) { NSLog(@%@, error.description); } }]; The error I encounter on my M1 Mac is consistently: Error Domain=NSCocoaErrorDomain Code=-1 (null). However, I'm unsure about what steps to take to resolve this issue. Just wondering can we test on-demand resources on apple silicon macs directly by 'Designed for iPad', or we can only test on real devices and simulators? I have read many documentations and websites but it seems like no one addresses about this.
I'm also having problem with Replace Container on real device. Even when I tried to create new iOS application to test it, when I replace the container, the application crashes. Easy way to replicate problem: Step 1: In Xcode, using project template, create new iOS application with CoreData support. Step 2: Build application and run it on real device with iOS 17. Step 3: Download Container for this application using Xcode. {menu - Window - Devices and Simulator). Step 4: Replace Container (the same container previously downloaded) using Xcode {menu - Window - Devices and Simulator). Step 5: Run application again on real device = crash/error. Errors: error: Failed to create directory: NSCocoaErrorDomain (513) CoreData: Unhandled exception finding default Directory URL '+[NSPersistentContainer defaultDirectoryURL] Could not conjure up a useful location for writing persistent stores.' My system configuration for development: Xcode 15.0.1 (also tested with Xcode 15.1 beta 3 with same error) iOS 17.1.2, i
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags:
2 versions 1 works 1 doesn't. UIViewRepresentable to show a PDF @AppStorage(DefaultsKey.userActiveBook.rawValue) var activeBook : URL = Bundle.main.url(forResource: BookPlaceHolder, withExtension: pdf)! func makeUIView(context: Context) -> PDFView { do { let pdfData = try Data(contentsOf: activeBook) pdfView.document = PDFDocument(data: pdfData) //<---- is nil ... } catch let Error { print(Error) } } fails with Error Domain=NSCocoaErrorDomain Code=260 The file “BookPlaceHolder.pdf” couldn’t be opened because there is no such file. func makeUIView(context: Context) -> PDFView { do { let pdfData = try Data(contentsOf: Bundle.main.url(forResource: BookPlaceHolder, withExtension: pdf)!) pdfView.document = PDFDocument(data: pdfData) ... } catch let Error { print(Error) } } Works perfectly. What is it with using @AppStorage to access the exact same URL causing the discrepancies ?
This problem is not repaired in Xcode 15.1 beta 3! This is a serious error that can be easily provoked: in the Window menu, select Device and Simulators, Download Container... and immediately Replace Container... with the one you just downloaded. When the app tries to access the file in .../Library/Application Support, the following error message appears: Thread 1: Fatal error: 'try!' expression unexpectedly raised an error: Error Domain=NSCocoaErrorDomain Code=513 Du hast nicht die Zugriffsrechte, um die Datei „Application Support“ im Ordner „Library“ zu sichern. UserInfo={NSFilePath=/var/mobile/Containers/Data/Application/F2ACE0F7-9446-46B7-8B82-AD269E62C2A1/Library/Application Support, NSUnderlyingError=0x2812861c0 {Error Domain=NSPOSIXErrorDomain Code=13 Permission denied}} Unfortunately this problem prevents us from testing and further developing our app.
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags:
Development Environment: Xcode Version: 14.3.1 macOS Ventura Version: 13.6.2 Architecture: Intel I am developing a macOS app with an accompanying XPC service and am encountering an issue where the XPC connection is immediately invalidated upon trying to establish it. The error message received is: Error Domain=NSCocoaErrorDomain Code=4099 The connection to service named com.appname.macos.app-name-xpc was invalidated. UserInfo={NSDebugDescription=The connection to service named com.appname.macos.app-name-xpc was invalidated: failed at lookup with error 3 - No such process.} Here's what I have verified so far: The XPC service has the correct CFBundleIdentifier and is located within the Contents/XPCServices directory of my app's bundle. Info.plist for the XPC service has ServiceType set to Bundled. The XPC service target's Installation Directory is the default location for XPC services (@executable_path/../XPCServices). Code signing and entitlements have been verified for both the main app and the XPC s