Post

Replies

Boosts

Views

Activity

KeyedUnarchive a previously object archived with NSArchiver archivedDataWithRootObject
Hi, in my previous macOS app I used to archive a dictionary to a preference file using [NSArchiver archivedDataWithRootObject:dictionary]; and to unarchive it using [NSUnarchiver unarchiveObjectWithData:dataFromDisk]; Now I would like to replace the 2 deprecated methods with NSError *error; NSSet *classSet = [NSSet setWithObjects:[NSDictionary class], [NSArray class], [NSString class], [NSNumber class], [NSData class], nil]; NSDictionary *dictionary = [NSKeyedUnarchiver unarchivedObjectOfClasses:classSet fromData:dataFromDisk error:&error]; But I get a nil dictionary and the error 4864: non-keyed archive cannot be decoded by NSKeyedUnarchiver. So I guess I should first keep on unarchiving the preferences dataFromDisk using the old deprecated method [NSUnarchiver unarchiveObjectWithData:dataFromDisk]; Then I could use the new NSKeyedArchiver and NSKeyedUnarchiver methods for the upcoming release. But, if this deprecated method [NSUnarchiver unarchiveObjectWithData:dataFromDisk]; fails to unarchive the old data (and on some machines now it fails), how could I use the new methods? Should I consider my old preference file gone? Is a way to force the new NSKeyedUnarchiver method to unarchive data previously archived with NSArchiver ?
0
0
29
1w
Unable to build Core Image kernels in XCode 16
My app is suddenly broken when I build it with XCode 16. It seems Core Image kernels compilation is broken in XCode 16. Answers on StackOverflow seem to suggest we need to use a downgraded version of Core Image framework as a workaround, but I am not sure if there is a better solution out there. FYI, I am using [[ stitchable ]] kernels and I see projects having stitchable are the ones showing issue. air-lld: error: symbol(s) not found for target 'air64_v26-apple-ios17.0.0' metal: error: air-lld command failed with exit code 1 (use -v to see invocation) Showing Recent Messages /Users/Username/Camera4S-Swift/air-lld:1:1: ignoring file '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/CoreImage.framework/CoreImage.metallib', file AIR version (2.7) is bigger than the one of the target being linked (2.6)
0
1
87
1w
Mocking or simulating CBPeripheral, CBCentralManager, etc in tests
I am developing an app that uses CoreBluetooth to communicate with a proprietary piece of hardware. I would like to be able to write tests for it, but there does not seem to be any way to mock or simulate the presence of, for example a CBPeripheral object. This library (https://github.com/NordicSemiconductor/IOS-CoreBluetooth-Mock) almost does what I need, but it's not quite flexible enough. I think they have the right idea, but it doesn't seem to be actively maintained anymore. This seems like a pretty big hole in the iOS SDK. Is there really not an officially supported way of testing BLE functionality?
3
0
174
2w
How do I query the "+" button in XCTest?
I have a + image in the UI from the following code struct QueryPlusButton: View { var body: some View { Button { } label: { Image(systemName: "plus") } } } However, I'm not able to query the + image in XCTest using any of the following queries let view = app.images["plus"] //let view = app.staticTexts["plus"] //let view = app.buttons["plus"] XCTAssertTrue(view.exists, "Plus button does not exist") The test fails. Is there a methodical way to determine what a query is for any UI element? Thank you.
1
0
116
1w
How to add a new target using Xcode16 and cocoapods
On my Mac I have MacOs15 and Xcode 16 installed. I'm working with cocoapods, when adding a new target to my App, pod update it fails. What can I do to solve the problem. hunter-movil-main % npx cap update ios ✔ Updating iOS plugins in 23.10ms [info] Found 6 Capacitor plugins for ios: -capacitor-community/fcm-3.0.2 -capacitor/app-4.1.1 -capacitor/haptics-4.1.0 -capacitor/keyboard-4.1.1 -capacitor/push-notifications-4.1.2 -capacitor/status-bar-4.1.1 ✖ Updating iOS native dependencies with pod install - failed! ✖ update ios - failed! [error] Analyzing dependencies Searching for inspections failed: undefined method `map' for nil ### Command /opt/homebrew/Cellar/cocoapods/1.15.2_1/libexec/bin/pod install ### Report * What did you do? * What did you expect to happen? * What happened instead? ### Stack CocoaPods : 1.15.2 Ruby : ruby 3.3.5 (2024-09-03 revision ef084cc8f4) [arm64-darwin24] RubyGems : 3.5.18 Host : macOS 15.0 (24A335) Xcode : 16.0 (16A242d) Git : git version 2.39.5 (Apple Git-154) Ruby lib dir : /opt/homebrew/Cellar/ruby/3.3.5/lib Repositories : trunk - CDN - https://cdn.cocoapods.org/ ### Plugins cocoapods-deintegrate : 1.0.5 cocoapods-plugins : 1.0.0 cocoapods-search : 1.0.1 cocoapods-trunk : 1.6.0 cocoapods-try : 1.2.0 ### Podfile ruby require_relative '../../node_modules/@capacitor/ios/scripts/pods_helpers' platform :ios, '13.0' use_frameworks! # workaround to avoid Xcode caching of Pods that requires # Product -> Clean Build Folder after new Cordova plugins installed # Requires CocoaPods 1.6 or newer install! 'cocoapods', :disable_input_output_paths => true def capacitor_pods pod 'Capacitor', :path => '../../node_modules/@capacitor/ios' pod 'CapacitorCordova', :path => '../../node_modules/@capacitor/ios' pod 'CapacitorCommunityFcm', :path => '../../node_modules/@capacitor-community/fcm' pod 'CapacitorApp', :path => '../../node_modules/@capacitor/app' pod 'CapacitorHaptics', :path => '../../node_modules/@capacitor/haptics' pod 'CapacitorKeyboard', :path => '../../node_modules/@capacitor/keyboard' pod 'CapacitorPushNotifications', :path => '../../node_modules/@capacitor/push-notifications' pod 'CapacitorStatusBar', :path => '../../node_modules/@capacitor/status-bar' end target 'App' do capacitor_pods # Add your Pods here pod 'Firebase/Messaging' end post_install do |installer| assertDeploymentTarget(installer) end ### Error RuntimeError - `PBXGroup` attempted to initialize an object with unknown ISA `PBXFileSystemSynchronizedRootGroup` from attributes: `{"isa"=>"PBXFileSystemSynchronizedRootGroup", "exceptions"=>["743C7E622CA48F72000F87A0"], "explicitFileTypes"=>{}, "explicitFolders"=>[], "path"=>"pushextension", "sourceTree"=>"<group>"}`
2
0
323
1w
Crash without stack trace in optimized builds on device (Xcode 16)
Hi, I'm looking for some advise how to narrow down the location of the crash. When I run the app with Debug configuration (GCC_OPTIMIZATION_LEVEL=0) everything just works. But in Release configuration with -Os the app crashes. Also need to mention that the crash happens on the device only, but not on the simulator. When the crash happens, there's no stack trace available. The crash happens every time, a couple seconds after I see the first screen. Currently I'm using Xcode Version 16.0 (16A242d), but I have also tried all combinations of: Xcode 16.1 Beta 1 Xcode 16.1 Beta 2 Device with iOS 18 Device with iOS 17.7 Device with iOS 17.6.1 The result is always the same. (lldb) bt * thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=257, address=0x100000002) * frame #0: 0x0000000100000002 Is there anything I can do to further narrow down the location of the crash? Here's a full crash report that I got from the device: https://gist.github.com/plu/e9ed984f438358b5fbf120148cbbaef0
1
0
63
1w
"xcrun xcresulttool get --format json --path" deprecated - what's the alternative?
Hi, I'm using the following command to extract information about the code coverage: xcrun xcresulttool get --format json --path /some/path/to/xcresult However, since Xcode 16 I get: Error: This command is deprecated and will be removed in a future release, --legacy flag is required to use it. But this message doesn't tell us what's the alternative to get the same result. Or are you just getting rid of useful functionality and there is no alternative?
4
1
434
2w
xcodebuild hangs for some users, not all
Mac OS: 12.3.1 Monterey (Mac Mini 202 Xcode: 13.4.1 'xcodebuild -version' hangs indefinitely for most users, except for one local admin account and one non-admin account (LDAP user). I've searched high and low and found some related issues on this forum and elsewhere, most of which indicate that the Xcode license has not been accepted and provide instructions to accept it from the command line. All of these have been tried countless times, plus Xcode 13.4.1 and CommandLineTools have been reinstalled, and still the issue remains: Only one non-admin user (myself) and the local admin user can run 'xcodebuild' from the command line without hanging. The same is true from Mac Terminal application in a remote console (VNC) session, or putty/xterm connected remotely via ssh. We can't upgrade Mac OS or Xcode as this is a build/test machine in a server farm and the specific OS and Xcode versions are required minimums for customer support purposes. Doesn't seem that there is setting unique to each user that could enable/disable Xcode, but the inner workings of Mac OS and Xcode remain largely a mystery. Please help!
3
0
105
1w
WebKit binary compatibility broken in iOS 18
The non-async signature for WKNavigationDelegate's decidePolicyForNavigationAction has changed between iOS 17 and 18. In 17 it is func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: @escaping (WKNavigationActionPolicy) -> Void) In 18 it adds the MainActor attribute to the decision handler func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: @escaping @MainActor (WKNavigationActionPolicy) -> Void) We deliver xcframeworks to our customers with objects that implement this function, and when those customers upgraded to Xcode 16.0 / iOS 18, those frameworks broke despite ABI stability (since that's unrelated to the WebKit SDK's public signatures). I presume this is because the WebKit dependency in the iOS 18 SDK does not match the signature used those older frameworks (and the IDE errors seem to support this). We will of course deliver new frameworks targeting the new SDK, but that takes regression testing and release planning. In the meantime, this has been exacerbated by the fact that macOS Sequoia does not support Xcode 15. Those of our customers whose machines updated to Sequoia cannot build their projects at all until we're able to deliver frameworks that are compatible. Was this an expected change? I didn't see any deprecation warnings in iOS 17, and unless we're supposed to bundle WebKit within the framework somehow, I'm not sure how we could have done this without forcing the Xcode versioning on our customers. Is there a way we package this differently or some other solution to make our existing frameworks compatible with iOS 18 without having to target that SDK?
3
0
253
1w
Enterprise API for Vision pro
We are working on to enable enterprise api account from our developer account. But it is not showing me that option. We are referring below link from apple : https://developer.apple.com/help/account/get-started/apple-developer-enterprise-program-api/ We don't find "Apple Developer Enterprise Program API configuration" in our developer account Inside Integration tab I am attach our developer account Screenshot. Please guide us!!
3
0
236
2w
Updateign provisioning taking forever
Hello, in the past couple of weeks I've been experience some problems with xcode regarding the signing & capabilities. I work in a company that makes customized apps for every of our clients and beacause of that we have about 200 targets in our project. In the past couple of weeks, I have been hanving trouble with the signing & capabilities in xcode. Some times is taking too long to load the poart where i select the team were the app will be upload and when it does it got stuck with the massege updating provisioning . There is anything that could have been done to not take too much time to the target get ready to be publiched? Thanks in advanced for any help.
2
3
611
Nov ’22
Xcode 16 Overheating issue on an M1 Pro
I’m using Xcode 16 on an M1 Pro and experiencing overheating issues. It seems like Apple rushed the release without addressing glitches that cause the laptop to overheat, which can directly affect battery life, decreasing its performance and, in turn, lowering the value of the Mac. I really dislike this from Apple. We pay a lot for their products, and issues like these devalue them.
0
0
116
1w