Post

Replies

Boosts

Views

Activity

Issue with storing NSCoding object in userdefaults
Hi all. I need to save an array of strings in userdefaults. I am using NSKeyedArchiver.archivedData(withRootObject: rootObject, requiringSecureCoding: false) to convert array of string to data and then save it in userdefaults. Inorder to retrieve the data back, I am using let data = self.userDefaults.data(forKey: "key")! let unarchiver = try NSKeyedUnarchiver(forReadingFrom: data) unarchiver.requiresSecureCoding = false let array = unarchiver.decodeObject(forKey: NSKeyedArchiveRootObjectKey) as? NSObject This was working perfectly till iOS 18. From iOS 18 in couple of devices, we are getting empty string array while we retrieve the value back from userdefaults. We observed this in an iPhone 12 pro and iPhone 15 running on iOS 18. iPhone 12 pro is facing this issue almost once everyday. In iPhone 15 this happens once in 2-3 days. Tried printing raw data directly from userdefaults. And I can see some data available. But when we convert that back to array of string, I am getting empty. Tried adding logs in catch block. But couldn't get any. What might be the cause of this issue?
1
0
138
Mar ’25
SPM Package dependencies doesn't show up in Link Binary with Library section
In our project we are using swift package to add framework dependencies for our project. Each frameworks are added as Target.binaryTarget(name: "", url: "", checksum: "") We were using Xcode 13.1 before and once new framework is added, it was listed in Link Binary with Library search and we were able to add it. See below image: Currently we upgraded to Xcode 14.2 and if we add a new framework, it is not getting listed as expected. See image: Is there anything changed in Xcode 14? How can we fix this issue?
0
0
415
Jul ’23
Is it ok to present a screen when tabbar item is clicked?
Our UX designer came with a strange requirement. When the user clicks the "Search" tab bar item, we need to present the search screen on top of currently selected screen. Please find the attachments. I was able to create this behaviour by using tabbarcontroller delegate methods. But during the app review, will it cause any problem as we are changing the default tab bar behaviour. Please find the attachments for a better idea.
1
0
477
Mar ’23