Posts under Developer Tools & Services topic

Post

Replies

Boosts

Views

Activity

Xcode 16 build warning
I encountered an issue when implementing the WKUIDelegate protocol and NSItemProviderWriting protocol. Below is a minimal example of the code that reproduces the issue: import UIKit import WebKit class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. } } class ItemProvider: NSObject, NSItemProviderWriting { static var writableTypeIdentifiersForItemProvider: [String] { fatalError() } func loadData( withTypeIdentifier typeIdentifier: String, forItemProviderCompletionHandler completionHandler: @escaping @Sendable (Data?, (any Error)?) -> Void ) -> Progress? { fatalError() } } extension ViewController: WKUIDelegate { func webView( _ webView: WKWebView, runJavaScriptAlertPanelWithMessage message: String, initiatedByFrame frame: WKFrameInfo, completionHandler: @escaping @MainActor @Sendable () -> Void ) { fatalError() } } When implementing the WKUIDelegate protocol after NSItemProviderWriting protocol, the following warning appears: Instance method 'webView(_:runJavaScriptAlertPanelWithMessage:initiatedByFrame:completionHandler:)' nearly matches optional requirement 'webView(_:runJavaScriptAlertPanelWithMessage:initiatedByFrame:completionHandler:)' of protocol 'WKUIDelegate' The target's SWIFT_VERSION is 6.0.
0
0
413
Oct ’24
Returned from Unity games causes my app to slow and it works normal after siri or locking unlocking phone
Dear Developers, Am facing this issue on my production app. Tried everything. Removed almost everything and tested the app. Even then this issue happens. The unity games, am talking about are the slow and sluggish types, which feel like 30 fps and after returning from them, my app sounds slow and feels a little bit sluggish. As soon as i lock/unlock the device , it becomes perfectly fine. Even i was debugging with xcode, i had the issue, then i rebuild the app in xcode and opening it on device, the same issue. As soon as i locked the device or opened siri with lockbutton or moved to a native app, and came back, app is completely fine. Craziest issue, i have ever seen. Though killing the app and opening it again on iphone also works. Only anxiety is that maybe my users when returning from other slow 3rd party games which are my competitors might slow down the experience. I have tried almost everything in my app, removed all functions and just ran sounds. Retried with different ways of playing sounds. Nothing works. Dont know it is a frame rate issue, because i replaced all my animations causing framerate not to cross 60fps even then didnt work. Device on which am testing is Iphone 14 pro max.
0
0
378
Sep ’24
Getting CXErrorCodeRequestTransactionErrorInvalidAction errors only on older iOS before 16.5
Need help from Apple to provide more details on what can contribute to "CXErrorCodeRequestTransactionErrorInvalidAction". For the same client build, we are seeing a spike of errors only from older OS (< 16.5) with error code 6 (.invalidAction) when requesting a transaction with CXStartCallAction. This happened after we update to XCode 16.1.
0
0
345
Oct ’24
XCode 16.0 "Cannot find (your_variable) in scope (your_scope)"
Hello! Trying to debug with ol' reliable print object (po) but getting error that such variable does not exist in current scope (even tho i have breakpoint literally on it, before it will "return" from current context (return myObject) Any ideas on why this might occur? Prior to xcode 16 - i faced this error only when i made typo in variable name or it actually was different scope (i jumped in stacktrace to other call)
0
0
231
Oct ’24
The requested device could not be found because multiple devices matched the request.
Hello, This is the repost of the issue reply from Xcode 16 beta 2 with multiple iOS simruntime installed macs. I stopped using sudo as Apple Developer Tools Engineer said but the same thing goes on the phase of xcodebuild with old simulator destinations. 15:39:45 Exit status of command 'set -o pipefail && xcodebuild -project "SampleApp.xcodeproj" -scheme "SampleApp" -configuration "Release" clean -destination "platform=iOS Simulator,name=iPhone 13 Pro,OS=15.4" -derivedDataPath "/path/to/.derived_data/sim_app" build | tee '/path/to/artifacts/logs/build_sim/xcodebuild.log' | xcpretty --color --simple' was 70 instead of 0. 15:39:45 2024-09-25 15:39:14.700 xcodebuild[91142:22610080] Malformed bundle does not contain an identifier at /Library/Developer/CoreSimulator/Volumes/tvOS_22J5335e/Library/Developer/CoreSimulator/Profiles/Runtimes/tvOS 18.0.simruntime 15:39:45 2024-09-25 15:39:14.760 xcodebuild[91142:22610212] Malformed bundle does not contain an identifier at /Library/Developer/CoreSimulator/Volumes/tvOS_22J5335e/Library/Developer/CoreSimulator/Profiles/Runtimes/tvOS 18.0.simruntime 15:39:45 2024-09-25 15:39:43.986 xcodebuild[91142:22610077] Writing error result bundle to /var/folders/t2/vppt8b613w1b1pwfycwzgnc00000gr/T/ResultBundle_2024-25-09_15-39-0043.xcresult 15:39:45 xcodebuild: error: Unable to find a device matching the provided destination specifier: 15:39:45 { platform:iOS Simulator, OS:15.4, name:iPhone 13 Pro } 15:39:45 15:39:45 The requested device could not be found because multiple devices matched the request. ( 15:39:45 "<DVTiPhoneSimulator: 0x12467d3e0> {\n\t\tSimDevice: iPhone 13 Pro (7C44F49C-1406-4675-8297-0BB1E32030A4, iOS 15.4, Shutdown)\n}", 15:39:45 "<DVTiPhoneSimulator: 0x1246788e0> {\n\t\tSimDevice: iPhone 13 Pro (723AB83F-84B2-4553-A7FB-FE97FBC72A12, iOS 15.4, Shutdown)\n}" 15:39:45 ) ... 15:39:45 Available destinations for the "SampleApp" scheme: 15:39:45 { platform:macOS, arch:arm64, variant:Designed for [iPad,iPhone], id:00006020-0014092C3498C01E, name:My Mac } 15:39:45 { platform:iOS, id:dvtdevice-DVTiPhonePlaceholder-iphoneos:placeholder, name:Any iOS Device } 15:39:45 { platform:iOS Simulator, id:dvtdevice-DVTiOSDeviceSimulatorPlaceholder-iphonesimulator:placeholder, name:Any iOS Simulator Device } 15:39:45 { platform:visionOS Simulator, variant:Designed for [iPad,iPhone], id:5E4672C1-BFDC-4BF8-AECC-9101CAF005E2, OS:2.0, name:Apple Vision Pro } 15:39:45 { platform:visionOS Simulator, variant:Designed for [iPad,iPhone], id:F828FD1C-C6A9-4671-8A30-45888FE542C2, OS:2.1, name:Apple Vision Pro } 15:39:45 { platform:iOS Simulator, id:27B137B4-DDF5-4091-A77B-AEAE819E60BE, OS:15.4, name:iPad (9th generation) } 15:39:45 { platform:iOS Simulator, id:27B137B4-DDF5-4091-A77B-AEAE819E60BE, OS:15.4, name:iPad (9th generation) } 15:39:45 { platform:iOS Simulator, id:84E80242-3066-45BB-BE4A-24EC1512BE0E, OS:15.4, name:iPad (9th generation) } 15:39:45 { platform:iOS Simulator, id:84E80242-3066-45BB-BE4A-24EC1512BE0E, OS:15.4, name:iPad (9th generation) } ... 15:39:45 { platform:iOS Simulator, id:723AB83F-84B2-4553-A7FB-FE97FBC72A12, OS:15.4, name:iPhone 13 Pro } 15:39:45 { platform:iOS Simulator, id:723AB83F-84B2-4553-A7FB-FE97FBC72A12, OS:15.4, name:iPhone 13 Pro } 15:39:45 { platform:iOS Simulator, id:7C44F49C-1406-4675-8297-0BB1E32030A4, OS:15.4, name:iPhone 13 Pro } 15:39:45 { platform:iOS Simulator, id:7C44F49C-1406-4675-8297-0BB1E32030A4, OS:15.4, name:iPhone 13 Pro } 15:39:45 { platform:iOS Simulator, id:AA3C6F9C-A503-4301-8C70-760D20F31103, OS:15.4, name:iPhone 13 Pro Max } 15:39:45 { platform:iOS Simulator, id:AA3C6F9C-A503-4301-8C70-760D20F31103, OS:15.4, name:iPhone 13 Pro Max } ... Seems like the simruntimes are launched twice but have no decisive clue. For reproduction of the symptom, I'll add xcrun simctl runtime list: % xcrun simctl runtime list == Disk Images == -- iOS -- iOS 18.1 (22B5069a) - 558B1106-009E-4997-9915-68CA501B96DE (Ready) iOS 17.2 (21C62) - 04813A2D-9A0B-4CD2-97DD-92BE5937560C (Ready) iOS 17.4 (21E213) - 4532CD64-DDFC-4EB8-9D40-A2EF0A6D7CCC (Ready) iOS 17.5 (21F79) - 5225F9C1-D3B7-4CA8-95FE-C698C1EFA1DF (Ready) iOS 18.1 (22B5045f) - 72FF0A8A-5B59-4303-9683-0B5A3148F3E5 (Ready) iOS 16.4 (20E247) - E1699E3D-1F68-4535-94D4-F584D3232D79 (Ready) iOS 17.0.1 (21A342) - EC730386-D17C-4C1A-92A5-F06B6C502F4E (Ready) iOS 18.0 (22A3351) - 9B46965A-BB9C-4084-9F79-7BB67CCFF94E (Ready) iOS 15.4 (19E240) - 28A82EA5-0FE4-4595-BE6E-5EB93098547F (Ready) -- tvOS -- tvOS 17.2 (21K364) - 13634086-0FA9-49CA-BB04-E7E5C8803F28 (Ready) tvOS 15.2 (19K50) - 753520B7-93B1-4217-AD01-239C92386B5D (Ready) tvOS 16.4 (20L494) - B243C672-A2FD-428E-A910-5EA108403E7B (Ready) tvOS 18.1 (22J5543e) - 00E73B3D-2821-42EE-8448-EB28D3E95D9B (Ready) tvOS 17.0 (21J353) - 794FFE83-76EB-4CCE-91D4-6A27E88F2FE2 (Ready) tvOS 18.1 (22J5567a) - DA90203F-C57A-4E57-B6E1-6549F57D3D32 (Ready) tvOS 17.4 (21L224) - BBEAC6EA-7F1C-4D02-A10A-8B7ECCCEB6F7 (Ready) tvOS 17.5 (21L569) - 4714379D-46CF-402B-BBFD-FE9E384D3721 (Ready) tvOS 18.0 (22J356) - 0FF86611-1B12-4188-94D0-1C7B3E32BB23 (Ready) -- watchOS -- watchOS 9.4 (20T253) - F54A4AA5-4D95-4BFB-B290-ADCAB5C3F554 (Ready) watchOS 11.1 (22R5569a) - 9F78E186-30D4-436D-B5B2-B0D0849BF3A2 (Ready) watchOS 11.1 (22R5545f) - 17E76267-0F3B-4E35-9516-36F8D8A31B76 (Ready) watchOS 10.4 (21T214) - 4BE2D5F2-B4AB-4144-ADD3-28EF4D95928B (Ready) watchOS 8.3 (19S51) - B2FC21B1-E408-4BCD-924D-DA9712BB2CE9 (Ready) watchOS 10.0 (21R355) - F85C098B-BF3E-4E80-A5A7-6D351724806B (Ready) watchOS 10.2 (21S364) - 7219764C-D3AE-4744-A8CC-26403E2E6F0B (Ready) watchOS 10.5 (21T575) - 469E571D-4AA0-4E41-A788-DE0A302C6830 (Ready) watchOS 11.0 (22R349) - 91D05834-73B0-4942-A9FB-8813DDE047E6 (Ready) -- xrOS -- xrOS 2.1 (22N5567a) - 34E59475-EA24-4BDF-8A04-C171B408F94B (Ready) xrOS 2.1 (22N5548c) - 1D30800B-82AC-41C2-A1CE-3A24ABF7FE40 (Ready) xrOS 1.1 (21O209) - 0B623825-9B01-4948-86D7-C11E2EACDFC1 (Ready) xrOS 1.2 (21O5565d) - 62ADDB4B-D407-4966-952E-513FE39AE7B2 (Ready) xrOS 1.0 (21N305) - 695C785B-09B6-4181-AC14-284B3EA37163 (Ready) xrOS 2.0 (22N318) - 6FE72E19-1B8D-4F2C-B53B-F39DEE71C492 (Ready) Total Disk Images: 33 (183.3G) Thanks in advance.
0
0
416
Oct ’24
Unable to run Xcode on my iPhone
I have enabled Developer mode on the iPhone and paired my device. I see it as an option on Xcode, but I am unable to run any simulations on my device. When I go into Settings->General->VPN & Device Management, I only see an option for VPN, not for my Mac. What do I need to do to be able to run my app on my iPhone? Thank you
0
0
154
Oct ’24
xCode升级到16.0后编译webrtc代码报错 _Float16 is not supported on this target
xCode升级到16.0后编译webrtc代码报错: [23/996] CXX clang_x64/obj/third_party/protobuf/protobuf_full/field_mask.pb.o FAILED: clang_x64/obj/third_party/protobuf/protobuf_full/field_mask.pb.o ../../third_party/llvm-build/Release+Asserts/bin/clang++ -MMD -MF clang_x64/obj/third_party/protobuf/protobuf_full/field_mask.pb.o.d -DHAVE_ZLIB -D_LIBCPP_HAS_NO_ALIGNED_ALLOCATION -DCR_XCODE_VERSION=1600 -DCR_CLANG_REVISION="n346557-4e0d9925-1" -D_LIBCPP_ABI_UNSTABLE -D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS -D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS -D_LIBCPP_ENABLE_NODISCARD -DCR_LIBCXX_REVISION=375504 -D__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES=0 -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DGOOGLE_PROTOBUF_NO_RTTI -DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER -DHAVE_PTHREAD -I../.. -Iclang_x64/gen -I../../third_party/protobuf/src -I../../third_party/zlib -fno-strict-aliasing -fstack-protector -fcolor-diagnostics -fmerge-all-constants -arch x86_64 -Wno-builtin-macro-redefined -D__DATE__= -D__TIME__= -D__TIMESTAMP__= -Xclang -fdebug-compilation-dir -Xclang . -no-canonical-prefixes -O2 -fno-omit-frame-pointer -gdwarf-4 -g2 -isysroot ../../../../../../../../../Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk -mmacosx-version-min=10.10.0 -fvisibility=hidden -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -Wall -Wno-unused-variable -Wno-misleading-indentation -Wunguarded-availability -Wno-range-loop-analysis -Wno-missing-field-initializers -Wno-unused-parameter -Wno-c++11-narrowing -Wno-unneeded-internal-declaration -Wno-undefined-var-template -Wno-ignored-pragma-optimize -Wno-implicit-int-float-conversion -Wno-final-dtor-non-final-class -Wno-builtin-assume-aligned-alignment -Wno-deprecated-copy -Wno-non-c-typedef-for-linkage -Wno-pointer-to-int-cast -Wno-unused-function -Wno-shorten-64-to-32 -std=c++14 -stdlib=libc++ -fno-exceptions -fno-rtti -nostdinc++ -isystem../../buildtools/third_party/libc++/trunk/include -isystem../../buildtools/third_party/libc++abi/trunk/include -fvisibility-inlines-hidden -c ../../third_party/protobuf/src/google/protobuf/field_mask.pb.cc -o clang_x64/obj/third_party/protobuf/protobuf_full/field_mask.pb.o In file included from ../../third_party/protobuf/src/google/protobuf/field_mask.pb.cc:4: In file included from ../../third_party/protobuf/src/google/protobuf/field_mask.pb.h:8: In file included from ../../buildtools/third_party/libc++/trunk/include/string:504: In file included from ../../buildtools/third_party/libc++/trunk/include/string_view:175: In file included from ../../buildtools/third_party/libc++/trunk/include/__string:56: In file included from ../../buildtools/third_party/libc++/trunk/include/algorithm:643: In file included from ../../buildtools/third_party/libc++/trunk/include/memory:653: In file included from ../../buildtools/third_party/libc++/trunk/include/typeinfo:60: In file included from ../../buildtools/third_party/libc++/trunk/include/exception:81: In file included from ../../buildtools/third_party/libc++/trunk/include/cstdlib:85: In file included from ../../buildtools/third_party/libc++/trunk/include/stdlib.h:100: In file included from ../../buildtools/third_party/libc++/trunk/include/math.h:303: ../../../../../../../../../Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/usr/include/math.h:614:27: error: _Float16 is not supported on this target extern _Float16 __fabsf16(_Float16) __API_AVAILABLE(macos(15.0), ios(18.0), watchos(11.0), tvos(18.0)); 这个怎么解决?
0
1
417
Oct ’24
Test Flight Availability
It seems Test Flight is unavailable as this is the message I recieve when trying to install my app in Test Flight. "Could not install ______. TestFlight is currently unavailable. Try again" Yet, all systems are rosy according to the system status page (https://developer.apple.com/system-status/). Is this status page updated manually when somebody complains or is it actually testing anything?
0
0
178
Oct ’24
__isPlatformVersionAtLeast SIGABRT (ABORT)
I am working on a cross-platform application, and we recently released updates for our apps. We received a large number of crashes in our Crashlytics logs. All the crashes seem to occur in the APM submodule classes with "__isPlatformVersionAtLeast SIGABRT (ABORT)." While checking the Crashlytics event summary details, I found that the crashes happen during the execution of the didFinishLaunchingWithOptions function in the AppDelegate. didFinishLaunchingWithOptions: - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { //Firebase [FIRPerformance sharedInstance].instrumentationEnabled = 0; [FIRApp configure]; NSDictionary *props = @{ @"TESTING": @"iOS", @"Date": [NSDate date] }; //Clevertap [[CleverTap sharedInstance] setInAppNotificationDelegate:self]; [[CleverTap sharedInstance] setPushNotificationDelegate:self]; NSString *appPath = [[NSBundle mainBundle] bundlePath]; NSLog(@"appPath ------ %@",appPath); // Config an additional instance NSLog(@"multiple instance registration"); CleverTapInstanceConfig *ctConfig = [[CleverTapInstanceConfig alloc] initWithAccountId:@"TEST*******" accountToken:@"TEST*****"]; NSLog(@"multiple instance registration %@",ctConfig); CleverTap *additionalCleverTapInstance = [CleverTap instanceWithConfig:ctConfig]; [AEPMobileCore setLogLevel:AEPLogLevelDebug]; [AEPMobileCore configureWithAppId:@"99********"]; return YES; } Podfile: pod 'Firebase/Analytics' pod 'Firebase/Auth' pod 'Firebase/Crashlytics', '10.28.1' pod 'FirebasePerformance', '10.28.0' pod 'FirebaseRemoteConfig' pod 'CleverTap-iOS-SDK', '6.2.1' Stack Trace: Crashed: APMIdentityWorkerQueue 0 libsystem_kernel.dylib 0xc274 __pthread_kill + 8 1 libsystem_pthread.dylib 0x7ef8 pthread_kill + 268 2 libsystem_c.dylib 0x77ad8 abort + 128 3 libsystem_malloc.dylib 0x9c38 malloc_vreport + 896 4 libsystem_malloc.dylib 0x98a8 malloc_report + 64 5 libsystem_malloc.dylib 0x8e80 find_zone_and_free + 528 6 App 0xfe574 (Missing UUID 0faca6be3dbe3121a960c0897cece480) 7 App 0xf7e04 (Missing UUID 0faca6be3dbe3121a960c0897cece480) 8 App 0xfc250 (Missing UUID 0faca6be3dbe3121a960c0897cece480) 9 App 0xfbbec (Missing UUID 0faca6be3dbe3121a960c0897cece480) 10 App 0x2b4d00 (Missing UUID 0faca6be3dbe3121a960c0897cece480) 11 App 0x2bed74 (Missing UUID 0faca6be3dbe3121a960c0897cece480) 12 App 0x18344c (Missing UUID 0faca6be3dbe3121a960c0897cece480) 13 libsystem_pthread.dylib 0x7ef8 pthread_kill + 268 14 App 0x28354fc __isPlatformVersionAtLeast + 4384462076 15 ??? 0x3015b5920 (Missing) 16 ??? 0xd5e00078c (Missing) 17 ??? 0x1f058ed (Missing) APMExperimentWorkerQueue 0 libsqlite3.dylib 0x815f0 sqlite3_table_column_metadata + 2400 1 libsqlite3.dylib 0x13b2c sqlite3_exec + 46032 2 libsqlite3.dylib 0xaae0 sqlite3_exec + 9092 3 libsqlite3.dylib 0x9ac8 sqlite3_exec + 4972 4 libsqlite3.dylib 0x9158 sqlite3_exec + 2556 5 libsqlite3.dylib 0x12830 sqlite3_exec + 41172 6 libsqlite3.dylib 0x11f20 sqlite3_exec + 38852 7 libsqlite3.dylib 0x11e64 sqlite3_exec + 38664 8 libsqlite3.dylib 0xb14bc sqlite3_sourceid + 132108 9 libsqlite3.dylib 0xd130 sqlite3_exec + 18900 10 libsqlite3.dylib 0xc224 sqlite3_exec + 15048 11 libsqlite3.dylib 0x9ac8 sqlite3_exec + 4972 12 libsqlite3.dylib 0x9158 sqlite3_exec + 2556 13 libsqlite3.dylib 0x8d30 sqlite3_exec + 1492 14 App 0x58249c -[APMSqliteStore prepareSQL:error:] + 4339819676 15 App 0x58295c -[APMSqliteStore validateDatabaseWithError:] + 4339820892 16 App 0x58289c -[APMSqliteStore openAndValidateDatabase:] + 4339820700 17 App 0x57ecbc -[APMSqliteStore initWithDatabasePath:error:] + 4339805372 18 App 0x505ae4 -[APMEDatabase initializeDatabaseResourcesWithContext:databasePath:] + 4339309284 19 App 0x505a0c -[APMEDatabase initWithPath:] + 4339309068 20 App 0x50d294 -[APMETaskManager startTaskManagerOnWorkerQueue] + 4339339924 21 App 0x50d24c __35-[APMETaskManager startTaskManager]_block_invoke + 4339339852 22 App 0x50e578 __46-[APMETaskManager dispatchAsyncOnWorkerQueue:]_block_invoke + 4339344760 23 libdispatch.dylib 0x213c _dispatch_call_block_and_release + 32 24 libdispatch.dylib 0x3dd4 _dispatch_client_callout + 20 25 libdispatch.dylib 0xb400 _dispatch_lane_serial_drain + 748 26 libdispatch.dylib 0xbf30 _dispatch_lane_invoke + 380 27 libdispatch.dylib 0x16cb4 _dispatch_root_queue_drain_deferred_wlh + 288 28 libdispatch.dylib 0x16528 _dispatch_workloop_worker_thread + 404 29 libsystem_pthread.dylib 0x4934 _pthread_wqthread + 288 30 libsystem_pthread.dylib 0x10cc start_wqthread + 8 Deployment version: 12.2 Could anyone know the above issue?
0
1
332
Oct ’24
How to symbolize memory graph if symbols is not compiled into application
To reduce the app size, the application dmg file does not contains the symbols in it. But when we meet memory issue, I use "leaks 'appName' --outputGrap =memoryLeak.memgraph" to get a memory graph Because there is no symbols contained the application, there is no function names(module names) which allocate the memory from the memory graph. But, we save the symbols as separate .dSYM files when compile, Is there any way to use the .dSYM files to symbolize the memory graph in this case ?
0
0
265
Oct ’24
Tracking Transparency
Long story short. My app tracks users via cookies and allows them to see relevant ads and such. Apple wants me to implement App Tracking via Xcode. The issue is I am running on Windows OS and do not have the ability to make the changes needed to get this app approved. The app was built through a 3rd party app building site, and they have no solutions at this time. So not unless someone has an idea on how to make these changes myself, I am all ears.
0
0
1.6k
Oct ’24
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
152
Sep ’24