Hi,
I am creating a custom NSSecureUnarchiveFromDataTransformer in order to handle attributes of entities of type NSDateComponents.
It all works and I did not see any warnings in the "Issue navigator" inside Xcode but with Xcode 15 I started seeing this warning:
/Users/.../CustomNSSecureUnarchiveFromDataTransformer/CoreData:1:1 no NSValueTransformer with class name 'CustomSecureUnarchiveFromDataTransformer' was found for attribute 'testDate' on entity 'Item'
My use case is very simple, I have this custom transformer:
@objc(CustomSecureUnarchiveFromDataTransformer)
final class CustomSecureUnarchiveFromDataTransformer: NSSecureUnarchiveFromDataTransformer {
override class var allowedTopLevelClasses: [AnyClass] {
return [NSDateComponents.self]
}
static let name = NSValueTransformerName(rawValue: String(describing: CustomSecureUnarchiveFromDataTransformer.self))
public static func register() {
let transformer = CustomSecureUnarchiveFromDataTransformer()
ValueTransformer.setValueTransformer(transformer, forName: name)
}
}
which is set to the Core data entity's "Transformer":
which leads to the warning in Xcode 15.
App works just fine and there are no problems during run time, but this warning is shown and I want to fix it.
Here is a simple test project https://github.com/VladimirAmiorkov/CustomNSSecureUnarchiveFromDataTransformer
Xcode
RSS for tagBuild, test, and submit your app using Xcode, Apple's integrated development environment.
Posts under Xcode tag
133 Posts
Sort by:
Post
Replies
Boosts
Views
Activity
Problem: iOS 16.4 runtime targets are not available for selection, however the 16.4 simulator shows as installed under "Manage run destinations"
Config: Xcode 15.0, Sonoma 14.0, M1 Mac-Mini
Background: I write and maintain apps for my business unit. A co-worker dropped a phone on my desk and said 'The app doesn't work anymore, can you fix it'. Well, it turns out the phone is running iOS 16.6. The OS had been upgraded. This sent me down the path of upgrading Xcode on a development Mac, which also forced a MacOs upgrade on me. The end result is I now have XCode 15 on Sonoma, but have an iOS 16.6 device that I'm trying to target. Since I don't have any iOS 17 devices I didn't install the 17.0 runtime.
To install the "16.6 runtime" I went to: "Xcode - Settings - Platforms" and hit the + in the lower left and under "Previously released simulators" I selected iOS.
I selected iOS 16.4 as it was the closest I could see to 16.6 so I'm assuming it still works with 16.6. It took a few attempts to download correctly, but it now shows up in my platforms as "iOS 16.4 Simulator 6.18 GB on disk".
If I select "Product - Destination - Manage Run Destinations" I can see simulators for 10 different iOS devices (from iPad 10th gen to iPhone SE) all running iOS 16.4.
Great! I must be ready to develop and test for 16.6. Right?
Nope.
In the dropdown beside my App name the only option that is shown to me is "iOS 17" and the "Get" button beside it. I was expecting to my iOS 16.4 simulators as available target destinations, but there's nothing other than "iOS 17 - Get".
This is an old App that I'm maintaining so its deployment target is not new. Selecting a different iOS Deployment target doesn't have an effect.
I tried going into Manage Run Destinations and selected my iPhone 14 simulator on iOS 16.4 as "show run destination always". - no change
Older iOS version do not show as destinations.
Anyone else encounter this? Did you figure it out?
Help?
Thx
This is really a disgusting function and I can't turn it off. Because the check box is grey, no way to turn it off. Even I connect my device via cables.
Debug becomes slow. Although I connect my device via cable.
And I'm developing a VPN application, it's rediculous that once I connect VPN from my device, Xcode will disconnect from my device.
I can't stand this function any m
ore. Does anyone know how to turn it off?
I just finished my first mobile app using .Net Maui. I have created all of the required certificatee, identifier, and profile in my Apple developer account and downloaded them to my MacAir. On my Windows machine I connect to my MacAir in VS2022 and build my release. Then I go to publish and I get this error:
Cannot create an IOS archive 'AgentManagerMobile'. Process cannot be executed on XMA server.
MessagingRemoteException: An error occurred on client Build1647067 while executing a reply for topic xvs/build/16.4.7067/execute-task/{AppName}/399e8ad002fWriteAppManifest
ArgumentNullException: Value cannot be null.
Parameter name: path2
What is parameter path2? Can anyone help with solving this?
Thanks, Phill
I have a project that has a number of plugins in it. They are compiled and placed in the correct location and the build runs fine in the Debug / Release schemes. If I archive the build with Xcode 15 the resulting build generates a number of errors symbol not found in flat namespace '_OBJC_CLASS_$_XXXX for various classes that are part of the main application including the AppDelegate and other classes. This does not occur with Xcode 14.3.1 or previous versions. It still occurs in Xcode 15.1 beta 1. This happens regardless if I notarize the build with Apple or not.
Has anyone seen anything like this? Any ideas how to resolve it?
My current workaround is to use xcodebuild to compile a Release build and notarize that build.
I am suddenly unable to connect to my iPhone (running iOS 17.0) in Xcode (either 15 or the last 15 beta). I get this error:
The developer disk image could not be mounted on this device.. Error mounting image: 0xe8000115 (kAMDMobileImageMounterDevicePropertyQueryFailure: Failed to query device property.)
I am able to see the disk image iOS_DDI.dmg in the Finder by opening /Users/cmonsour/Library/Developer/DeveloperDiskImages/
I have restarted both computer and iPhone, re-enabled Developer Mode, cleared Derived Data. I am not running a VPN. I am running the latest Xcode. I upgraded from Ventura to Sonoma with no improvement.
Any help appreciated. Unable to run anything from Xcode on my iPhone now, which is quite frustrating.
Details are as follows:
The developer disk image could not be mounted on this device.
Domain: com.apple.dt.CoreDeviceError
Code: 12040
Failure Reason: Error mounting image: 0xe8000115 (kAMDMobileImageMounterDevicePropertyQueryFailure: Failed to query device property.)
User Info: {
DDIPath = "/Users/cmonsour/Library/Developer/DeveloperDiskImages/iOS_DDI.dmg";
DVTErrorCreationDateKey = "2023-10-01 18:33:29 +0000";
DeviceIdentifier = "A4E1792C-1396-4BAF-A1E1-73C19F9FB8A4";
IDERunOperationFailingWorker = IDEInstallCoreDeviceWorker;
NSURL = "file:///Users/cmonsour/Library/Developer/DeveloperDiskImages/iOS_DDI.dmg";
Options = {
MountedBundlePath = "file:///private/var/tmp/CoreDevice_DDI_Staging_501/A4E1792C-1396-4BAF-A1E1-73C19F9FB8A4/";
UseCredentials = 0;
};
"com.apple.dt.DVTCoreDevice.operationName" = enablePersonalizedDDI;
}
--
Error mounting image: 0xe8000115 (kAMDMobileImageMounterDevicePropertyQueryFailure: Failed to query device property.)
Domain: com.apple.mobiledevice
Code: -402652907
User Info: {
FunctionName = AMDeviceRemoteMountPersonalizedBundle;
LineNumber = 2108;
}
--
Failed to initialize remote device attributes: 0xe8000115 (kAMDMobileImageMounterDevicePropertyQueryFailure: Failed to query device property.)
Domain: com.apple.mobiledevice
Code: -402652907
User Info: {
FunctionName = "-[PersonalizedImage mountImage:]";
LineNumber = 1772;
}
--
Failed to retrieve personalization identifiers: 0xe8000115 (kAMDMobileImageMounterDevicePropertyQueryFailure: Failed to query device property.)
Domain: com.apple.mobiledevice
Code: -402652907
User Info: {
FunctionName = "-[PersonalizedImage initializeRemoteDeviceAttributes:]";
LineNumber = 1367;
}
--
Event Metadata: com.apple.dt.IDERunOperationWorkerFinished : {
"device_isCoreDevice" = 1;
"device_model" = "iPhone14,5";
"device_osBuild" = "17.1 (21B5045h)";
"device_platform" = "com.apple.platform.iphoneos";
"dvt_coredevice_version" = "348.1";
"dvt_mobiledevice_version" = "1643.2.4";
"launchSession_schemeCommand" = Run;
"launchSession_state" = 1;
"launchSession_targetArch" = arm64;
"operation_duration_ms" = 173097;
"operation_errorCode" = "-402652907";
"operation_errorDomain" = "com.apple.dt.CoreDeviceError.12040.com.apple.mobiledevice";
"operation_errorWorker" = IDEInstallCoreDeviceWorker;
"operation_name" = IDERunOperationWorkerGroup;
"param_debugger_attachToExtensions" = 0;
"param_debugger_attachToXPC" = 1;
"param_debugger_type" = 3;
"param_destination_isProxy" = 0;
"param_destination_platform" = "com.apple.platform.iphoneos";
"param_diag_MainThreadChecker_stopOnIssue" = 0;
"param_diag_MallocStackLogging_enableDuringAttach" = 0;
"param_diag_MallocStackLogging_enableForXPC" = 1;
"param_diag_allowLocationSimulation" = 1;
"param_diag_checker_tpc_enable" = 1;
"param_diag_gpu_frameCapture_enable" = 0;
"param_diag_gpu_shaderValidation_enable" = 0;
"param_diag_gpu_validation_enable" = 0;
"param_diag_memoryGraphOnResourceException" = 0;
"param_diag_queueDebugging_enable" = 1;
"param_diag_runtimeProfile_generate" = 0;
"param_diag_sanitizer_asan_enable" = 0;
"param_diag_sanitizer_tsan_enable" = 0;
"param_diag_sanitizer_tsan_stopOnIssue" = 0;
"param_diag_sanitizer_ubsan_stopOnIssue" = 0;
"param_diag_showNonLocalizedStrings" = 0;
"param_diag_viewDebugging_enabled" = 1;
"param_diag_viewDebugging_insertDylibOnLaunch" = 1;
"param_install_style" = 0;
"param_launcher_UID" = 2;
"param_launcher_allowDeviceSensorReplayData" = 0;
"param_launcher_kind" = 0;
"param_launcher_style" = 99;
"param_launcher_substyle" = 8192;
"param_runnable_appExtensionHostRunMode" = 0;
"param_runnable_productType" = "com.apple.product-type.application";
"param_structuredConsoleMode" = 1;
"param_testing_launchedForTesting" = 0;
"param_testing_suppressSimulatorApp" = 0;
"param_testing_usingCLI" = 0;
"sdk_canonicalName" = "iphoneos17.0";
"sdk_osVersion" = "17.0";
"sdk_variant" = iphoneos;
}
--
System Information
macOS Version 14.0 (Build 23A344)
Xcode 15.0 (22265) (Build 15A240d)
Timestamp: 2023-10-01T14:33:29-04:00
Attempting to launch a widget in Debug mode on Sonoma from Xcode 15 is failing with the following message:
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.)
Looking in console I see this message:
macOSTaskPolicy: (com.apple.debugserver) may not get the task control port of (MacGalleryWidget) (pid: 1851): (MacGalleryWidget) is hardened, (MacGalleryWidget) doesn't have get-task-allow, (com.apple.debugserver) is a declared debugger(com.apple.debugserver) is not a declared read-only debugger
What Xcode settings should I be looking at to rectify this? I suspect I may have something that's out of whack.
I reinstalled the macOs from macOS recovery, Then installed the new Xcode 15, Everything worked fine but when I tried to commit my code the commit button does not showing.
The image from my Xcode app:
The new console in Xcode 15 is so terrible bad. Is it possible to get back the old console ?
SwiftUI preview hangs on "Preparing iPhone Simulator for Previews". Also simulator hangs when trying to build and run. This occurred after I installed iOS 17 simulator. I tried reverting back to an iOS 16 version of the simulator, but haven't figured out how to do that. Build and run to an iPhone device works fine. Any ideas would be appreciated. Thanks.
We have separated much of our UI into different packages to reduce complexity and compile time. When we recently tested using new .xcstrings string catalogs, we hit an unexpected problem.
Strings extracted from SwiftUI components like Text or Button are extracted into the Localizable.xcstrings in the same package, but the default behaviour of Text(_ key:tableName:bundle:comment:) is to use Bundle.main.
When the default behaviour of the string extraction isn't to extract to the main app target, this introduces a very fragile system where it's easy to add code that looks localised, but ends up failing lookup at runtime.
I don't feel comfortable that we will always remember to define the correct module every time we create a Text. Also, other components like Button doesn't have an init that takes a Bundle, so we would also have to remember that Button(_ titleKey:action:) can now only be used in a package if we make sure that the main bundle contains a matching key.
Is there a way for us to make sure that strings are always extracted to the same place as they are resolved against by default? Either by having strings in packages extracted to an xcstrings file in the main app or having Text default to resolving against the module bundle by default?
I've recently installed Xcode Version 15.0 (15A240d) and when I set a breakpoint it doesn't stop on the line of code where the breakpoint is set. Rather, it opens another window with the hex code. If I press F6 it doesn't highlight the next line of code, but I can see that it moved because the variables are changing.
Is this a known bug? I have tried all the usual stuff like deleting derived data and restarting everything. I have even deleted com.apple.dt.Xcode directory in ~/Library/Caches. to set things back to the defaults. The only thing I haven't done yet is reinstall Xcode.
Unfortunately, this is very bad timing as I need to get my app finished for the iOS17 and WatchOS 10 release.
Hi, since a while now, I've noticed that in Xcode 15 (beta 8), my iOS device running iOS 17 (latest beta), I can't seem to disable the setting "Connect via Network" in the Devices and Simulators window.
The controls are disabled, and stuck to 'on'.
I often also have issues with the 'Installing to device' step while development my apps, where a reboot of the iPad is required. My guess is that it gets stuck/confused how it is supposed to deploy and my network setup is a bit complicated due to VPN's, tight WiFi security etc.
Unpairing the device doesn't help with resetting this setting. After unpairing the top-right header (with the Take Screenshot controls etc...) even still shows the details of the unpaired device.
Anyone else has experienced this or know a solution.
I am using SwiftData for my model. Until Xcode 15 beta 4 I did not have issues. Since beta 5 I am receiving the following red warning multiple times:
'NSKeyedUnarchiveFromData' should not be used to for un-archiving and will be removed in a future release
This seems to be a CoreData warning. However, I am not using CoreData directly. I have no way to change the config of CoreData as used by SwiftData.
My model just uses UUID, Int, String, Double, some of them as optionals or Arrays. I only use one attribute (.unique).
None of my existing apps (both in-AppStore and in-development) nor even a brand new WatchOS app can be installed to my Apple Watch. While using Xcode to build and deploy to my Watch, I get this:
”Waiting to reconnect to Apple Watch
Xcode will continue when the operation completes.”
However, this dialog persists and never completes.
I’m running all of the latest: MacOS 14 beta 4, Xcode 15 beta 5, Watch OS 10 beta 4, iOS 17 beta 4.
I’ve tried resetting my Watch (with “Erase All” option) and restarting the Mac, the phone and the watch.
Any help?
My usage of TextField.focused() works fine in Xcode 14.3.1 but is broken as of Xcode 15. I first noticed it in the second beta and it's still broken as of the 4th beta.
Feedback / OpenRadar # FB12432084
import SwiftUI
struct ContentView: View {
@State private var text = ""
@FocusState var isFocused: Bool
var body: some View {
ScrollView {
TextField("Test", text: $text)
.textFieldStyle(.roundedBorder)
.focused($isFocused)
Text("Text Field Is Focused: \(isFocused.description)")
}
}
}
Anyone know how to set Side By Side Comparison in the new commit UI? New UI seems to missing a lot of features like multi-select of files to discard/stage...
Getting this error several times when presenting a modal window over my splitview window when running it on my Mac using Swift/Mac Catalyst in XCode 14.2. When I click the Cancel button in the window then I get Scene destruction request failed with error: (null) right after an unwind segue.
2023-07-04 16:50:45.488538-0500 Recipes[27836:1295134] [WindowHosting] UIScene property of UINSSceneViewController was accessed before it was set.
2023-07-04 16:50:45.488972-0500 Recipes[27836:1295134] [WindowHosting] UIScene property of UINSSceneViewController was accessed before it was set.
2023-07-04 16:50:45.496702-0500 Recipes[27836:1295134] [WindowHosting] UIScene property of UINSSceneViewController was accessed before it was set.
2023-07-04 16:50:45.496800-0500 Recipes[27836:1295134] [WindowHosting] UIScene property of UINSSceneViewController was accessed before it was set.
2023-07-04 16:50:45.994147-0500 Recipes[27836:1295134] Unbalanced calls to begin/end appearance transitions for <UINavigationController: 0x7f7fdf068a00>.
bleep
2023-07-04 16:51:00.655233-0500 Recipes[27836:1297298] Scene destruction request failed with error: (null)
I don't quite understand what all all this means. (The "bleep" was a debugging print code I put in the unwind segue). I'm working through Apple's Mac Catalyst tutorial but it seems to be riddled with bugs and coding issues, even in the final part of the completed app which I dowmloaded and ran. I don't see these problems on IPad simulator.
I don't know if it's because Catalyst has problems itself or there's something else going on that I can fix myself. Any insight into these errors would be very much appreciated!
PS: The app seems to run ok on Mac without crashing despite the muliple issues
Hello Team,
I try to delete photo from Photos for that i used this method,
[[PHPhotoLibrary sharedPhotoLibrary] performChanges:^{
[PHAssetChangeRequest deleteAssets:@[assetToDelete]];
completionHandler:^(BOOL success, NSError *error) {
}];
This method pops up a dialog with Don't Allow or Delete. But some time in some iPhones not respond PHAssetChangeRequest deleteAssets method that's why that completionHandler not called because of that i can't perform any operation of PHPhotoLibrary then after.
If I restart my iPhone then it works. Many users of my app complained about this issue. I have an iPhone 11 with iOS 15.3. But some iOS 12,14,16 users also face the same issue.
So what exact issue is there? Is it related to iOS or a method?
Thanks,
Ankur
Is it possible to merge or split a string catalog? It doesn't seem possible now.
The workaround i use now is eidting the xcstrings file in TextEdit.