Wednesday, February 14, 2024
HomeiOS Developmentmacos - SwiftUI Stepper EXC_BAD_ACCESS crash on Mac (designed for iPhone) works...

macos – SwiftUI Stepper EXC_BAD_ACCESS crash on Mac (designed for iPhone) works okay in iOS sim or actual system


The issue lies when attempting to make use of any Stepper() and having the supported locations to incorporate Mac ( designed for iPhone ) and operating it on the Mac. On the iPhone / iOS actual system after all the stepper works okay.

The issue is it simply offers a BAD_EXC_ACCESS error.

Please check out:
https://developer.apple.com/boards/thread/730554

That is occurring on Sonoma 14.1.2, Xcode 15. iOS deployment goal at 16.0.

I do not know if there is a method to test if the app is operating in that compatibility mode on the Mac and if that’s the case, have another for Stepper() so it does not crash.


That is precisely what’s occurring to me and to this man over the at Apple dev thread. Mainly I can not use any Stepper when operating the native iOS app on the Mac.


From the developer discussion board publish:

Right here is code that presents the problem:

ContentView.swift

import SwiftUI

struct ContentView: View {
    @State var someValue = 5
    var physique: some View {
        VStack {
            Stepper("Stepper", worth: $someValue, in: 0...10)
        }
    }
}

When run from Xcode on an iOS system or the simulator, it runs tremendous.

Attempting to run it on the Mac, it crashes right here:

Stepper_01App.swift

import SwiftUI

@foremost // <-- Thread 1: EXC_BAD_ACCESS (code=2, handle=0x16a643f70)
struct Stepper_01App: App {
    var physique: some Scene {
        WindowGroup {
            ContentView()
        }
    }
}

Xcode 14.3 (14E222b), macOS Ventura 13.3.1 (a), Mac mini M2. Goal: Mac (Designed for iPhone).

We have now verified that the identical code crashes on all of the Apple Silicon Macs now we have entry to. Looking out the Web and Apple Developer boards I do not discover different experiences, so I type of really feel there have to be some degree of both person error or system/mission misconfiguration happening?

If any iOS app that used Steppers was simply crashing when attempting to run on a Mac, it looks as if this could be a giant deal.

If anybody has enter or can level out what we have to do in another way, it could be appreciated!



Supply hyperlink

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments