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
Search results for
NSCocoaErrorDomain
1,063 results found
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
TL:DR Can anyone provide guidance as to how to get the FileProvider testing API to work? It closes with no error and I have not been able to determine the issue despite careful attention to the documentation and signing. The Console logs seem to imply it is a Sandbox issue. Hi, Writing this as per suggested in the technical support section. I am trying to create some tests that involve controlling the calls from MacOS to the corresponding event functions in the FileProvider (e.g. fetchContents()) using the FileProviderExtension test API provided by Apple. I have thoroughly read the documentation (both online and within the API code) in order to get this to work. I have: Added the com.apple.developer.fileprovider.testing-mode entitlement to both my Main App as well as my FileProviderExtension Ensured my I have the correct account permissions, and provisioning profiles for my Main App as well as FileProviderExtension Added the line domain.testingModes = [.alwaysEnabled, .interactive] The issue: I found that set
I'm using applicationQueuePlayer in my application. I set Queue for it and it plays music. It was working fine in the app installed on my phone, but after phone was updated to iOS 16.4 it stopped working (see errors below). When I remove app from phone and recompiled and re-installed it to that phone, player started working normally. But when I replaced container via Xcodes Device and Simulators to previously saved - it stopped working again. Re-installing it on top of existing didn't fix it. It was only working if removed from phone completely and then installed from Xcode from scratched. This started happening after phone update to 16.4. When I installed app from scratch - it was working fine, but when 16.4.1 was release couple of days ago and I installed it on a phone, it again broke the applicationQueuePlayer in my app. Same thing - removing app from phone and installing from scratch from Xcode makes it work, but restoring old container via Devices and Simulators breaks it again. I presume it has somethin
During last night, Apple allegedly pushed new XProtect antivirus signatures. After that, I think XProtect found the malware Pirrit in my Xcode Simulator files from Apple. I'm not kidding. This is an excerpt from the XProtect log (notice the NSFilePath!): 2024-05-01 07:54:12.951 Pirrit 👉 no status_message report time 0.0000000 {action:report,path:{modificationDate:732892166.8634809,path:/Library/Developer/CoreSimulator/Images/1944D6AF-4D6B-4877-8F87-924EB62FC984.dmg,creationDate:732892166.8634809},status:{description:Error deleting path: /Library/Developer/CoreSimulator/Images/1944D6AF-4D6B-4877-8F87-924EB62FC984.dmg: Error Domain=NSCocoaErrorDomain Code=513 “1944D6AF-4D6B-4877-8F87-924EB62FC984.dmg” couldn’t be removed because you don’t have permission to access it. UserInfo={NSUserStringVariant=(n Removen), NSFilePath=/Library/Developer/CoreSimulator/Images/1944D6AF-4D6B-4877-8F87-924EB62FC984.dmg, NSUnderlyingError=0x1247612a0 {Error Domain=NSPOSIXErrorDomain Code=1 Operation not permitted}}.,caus
I just upgraded my Macbook & Xcode installation, as we are required to target the latest iOS SDK later this month. I am now unable to compile our app as the iOS runtime is not installed by default. I have tried to download the missing runtime by clicking on iOS 17.4 Not Installed - Get in the top title bar. I think that the initial download may have been interrupted. Now, when I click Get, I get a popup that suggests that I can't download the Runtime because the iOS Simulator is already installed. I'm guessing that Xcode is holding a reference to a non-existent installation somewhere, but I can't figure out how to get rid of it. I have tried completely uninstalling Xcode, and deleting /Library/Developer from both my personal directory and the system directory. I can't delete the iOS Simulator installation reference from Xcode directly either. When I try to, I get this error message: Unable to remove SimulatorRuntime Domain: com.apple.DVTFoundation Code: -1 User Info: { DVTErrorCreationDateKey = 2024-04-13
Hello there! I am trying to use PHPickerViewController to load videos, but I got a problem: I could load some videos only not all. I refer to the existing thread - https://developer.apple.com/forums/thread/652695, but dosen't work. This is the code I persent PHPickerViewController var config = PHPickerConfiguration() config.selectionLimit = 1 config.filter = .videos config.preferredAssetRepresentationMode = .current let picker = PHPickerViewController(configuration: config) picker.delegate = self present(picker, animated: true, completion: nil) Below is the relevant implementation of the method: func picker(_ picker: PHPickerViewController, didFinishPicking results: [PHPickerResult]): picker.dismiss(animated: true, completion: nil) for result in results { result.itemProvider.loadFileRepresentation(forTypeIdentifier: UTType.movie.identifier) { (url, error) in if let error = error { print(error) return } guard let url = url else { return } let fileName = (Date().timeIntervalSince1970).(url.pathExtension) let ne
I am unable to make any progress regarding DeviceActivityReport. The session from WWDC 2022 covers it very briefly. What I (hopefully correctly) understood is that we need to create an extension of type Activity report and inside it implement the body which is DeviceActivityReportScene that will display the charts and what not. And then in the app, we need to use DeviceActivityReport with SwiftUI to show the report which will be run in sandbox from the extension. But I cannot get anything to show up on the screen. Even when my extension view is just a static text to verify something gets displayed. I am trying to create the device activity report without any filter which should give me all activity data per the docs. This is shown in the Xcode console for the view that uses DeviceActivityReport. 2022-06-17 18:08:47.219785+0200 DeviceActivityTest[9613:954204] [default] LaunchServices: store (null) or url (null) was nil: Error Domain=NSOSStatusErrorDomain Code=-54 process may not map database UserInfo={NSDebugD
I need user installed app information like first install time (purchase to install) last time use Bundle.main.appStoreReceiptURL to request Receipt was successful but when i Reinstall the app by Xcode has ERROR:Error reading receipt data: Error Domain=NSCocoaErrorDomain Code=260 what wrong with ERROR?
Topic:
App Store Distribution & Marketing
SubTopic:
General
Tags:
App Store
StoreKit
App Store Receipts
I have 2 vesrion schema and Migration plan. Version 2: Add new properties and Property renamed. static let release: ModelContainer = { do { let schema = Schema(versionedSchema: V2Schema.self) let appGroupURL = FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: ***) let databaseURL = appGroupURL?.appending(path: Models.sqlite) let databaseName = Models let configuration = ModelConfiguration(databaseName, schema: schema, url: databaseURL!, cloudKitDatabase: .automatic) return try ModelContainer(for: schema, migrationPlan: ModelMigrationPlan.self, configurations: [configuration]) } catch { fatalError(error.localizedDescription) } }() enum ModelMigrationPlan: SchemaMigrationPlan { static var schemas: [VersionedSchema.Type] { [V1Schema.self, V2Schema.self] } static var stages: [MigrationStage] { [v1ToV2MigrationStage] } } When I test migration in UnitTest, It works fine. But In running in device, error is occurred. error: Store failed to load. (type: SQLite, url: file:///private/var/mobile/Co
I have two models: @Model class User: Codable { @Attribute(.unique) var username: String @Attribute(.unique) var email: String var firstName: String var lastName: String @Attribute(.unique) var id: Int @Relationship(inverse: House.members) var houses: [House] = [] init(username: String, email: String, firstName: String, lastName: String, id: Int) { self.username = username self.email = email self.firstName = firstName self.lastName = lastName self.id = id } enum CodingKeys: String, CodingKey { case username case email case firstName = first_name case lastName = last_name case id } required init(from decoder: Decoder) throws { ... } func encode(to encoder: Encoder) throws { ... } } and @Model class House: Codable { var name: String var city: String var address: String @Attribute(.unique) var id: Int var ownerID: Int var members: [User] init(name: String, city: String, address: String, id: Int, ownerID: Int, members: [User]) { self.name = name self.city = city self.address = address self.id = id self.ownerID =
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
iOS 17.4.1, iPhone 15 Pro. I pick photos from the user's photo library using: ... .photosPicker(isPresented: $addPhotos, selection: $pickedPhotos, matching: .images) .onChange(of: pickedPhotos) { import(photoItems: pickedPhotos) } The picker UI works ok, but then when I import the photos: private func import(photoItems: [PhotosPickerItem]) { for photoItem in photoItems { Log.debug(picked: (photoItem)) Task { do { let imageData = try await photoItem.loadTransferable(type: Data.self) guard let imageData else { Log.error(failed to load image data) return } guard let image = UIImage(data: imageData) else { Log.error(failed to create image from data) return } // use image .... } catch { Log.error(failed to load image data: (error)) } } } } Logging the picked photo gives: PhotosPickerItem(_itemIdentifier: C7E2F753-43F6-413D-BA42-509C60BE9D77/L0/001, _shouldExposeItemIdentifier: false, _supportedContentTypes: [<_UTCoreType 0x1ebcd1c10> public.jpeg (not dynamic, declared), <_UTCoreType 0x1ebcd1d70> public
Now I got this new Error error description -> Error Domain=NSCocoaErrorDomain Code=4099 The connection to service named com.FxPlugTestXPC was invalidated: failed at lookup with error 3 - No such process. UserInfo={NSDebugDescription=The connection to service named com.FxPlugTestXPC was invalidated: failed at lookup with error 3 - No such process.} , error user info -> { NSDebugDescription = The connection to service named com.FxPlugTestXPC was invalidated: failed at lookup with error 3 - No such process.; } and error localizedDescription -> Couldn’t communicate with a helper application. @eskimo
Topic:
App & System Services
SubTopic:
Processes & Concurrency
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
Issue Summary Hi all, I'm working on an Intents Extension for my app, however when I try to run an intent, Xcode pops up the following error: Could not attach to pid: 965 attach failed (Not allowed to attach to process. Look in the console messages (Console.app), near the debugserver entries, when the attach failed. The subsystem that denied the attach permission will likely have logged an informative message about why it was denied.) An image of the error: This only happens when I try debugging the Intent Extension. Running the main app target or another extension target (e.g. notifications) doesn't produce this error. Build Setup Here are the details of my build setup: Mac Mini M1 Xcode 13 Building to iPhone 11 Pro Max, iOS 15.0.2. I've also tried building to my iPad Pro 12.9 w/ iOS 15.1 and hit the same issue. Things I've tried: Make sure Debug executable is unchecked in the scheme I've tried changing the Launch setting to Automatic and Wait for the executable to be launched I've made sure to run sudo DevT