Hey everyone,
I'm a new developer working on my app. I'm facing an unusual problem during the App Store review process. The app works perfectly on my physical devices, running iOS 18.0 developer beta, but it consistently crashes on simulators with iOS 17.5. Due to this issue, my app has been rejected for iOS 17.5 because of the crashes. I know I should have avoided developing and testing the app on different versions, so please go easy on me :(
Crash Details:
Steps Leading to Crash:
- Opened the app
- Went to the Stocks section
- Clicked on Buy
- App crashed
The Breakpoint Exception:
Thread 1: EXC_BREAKPOINT (code=1, subcode=0x21b9f1620)
Generated Infrastructure Code Section Triggering Crash:
{
@storageRestrictions(accesses: _$backingData, initializes: _stock)
init(initialValue) {
_$backingData.setValue(forKey: \.stock, to: initialValue)
_stock = _SwiftDataNoType()
}
get {
_$observationRegistrar.access(self, keyPath: \.stock)
return self.getValue(forKey: \.stock)
}
set {
_$observationRegistrar.withMutation(of: self, keyPath: \.stock) {
self.setValue(forKey: \.stock, to: newValue)
}
}
}
The crash appears to be related to Swift Data handling during the trade operation in my app's TradeView.
While I've managed to temporarily fix the issue by running the app on iOS 18.0, this is not a practical solution for the App Store release, which is my immediate concern.
Has anyone else experienced similar issues with Swift Data on iOS 17.5? If yes, how did you solve it? Is there a known workaround or a better approach to ensure compatibility with iOS 17.5?
Thank you in advance for your valuable assistance. I truly appreciate your help!