Search results for

xcode github

94,047 results found

Post

Replies

Boosts

Views

Activity

Reply to NotificationCenter Crash On iOS 18+ Swift6.2
You were right. We've found out that the issue was that we registered an observer with addObserver using a #selector that pointed to a function marked as @MainActor, but we were calling the NotificationCenter.post method from a background thread. Apparently this caused the main-actor isolation check to fail, which led to a crash. Even though there is no data-race or UI operation in the function, looks like it is enough for the function to be @MainActor to cause a crash when called from outside the main thread. We fixed it by making sure the relevant NotificationCenter.post calls are executed on the main thread. Initially, we thought that marking the function with @MainActor would prevent it from being called from a nonisolated context by producing a compile-time error in Swift 6 mode. But since a Selector instance is not aware of the actor isolation of the target function, Xcode is not able to show a warning and it caused us to not realize the issue at first. I appreciate your guidance @DTS Engineer.
Topic: Programming Languages SubTopic: Swift Tags:
3w
Potential Structural Swift Concurrency Issue: unsafeForcedSync called from Swift Concurrent context
I occasionally get this error in Xcode’s console: Potential Structural Swift Concurrency Issue: unsafeForcedSync called from Swift Concurrent context. What does this mean, and how can I resolve it? Googling it doesn’t turn up any results. This doesn't crash the app - it’s just an error diagnostic that I see in the Xcode console. The app keeps running before and after the issue. Is there a way I can set a breakpoint to catch this where it happens?
8
0
2.0k
3w
SwiftUI Sheet view with @Query loses model context
I've run into a strange issue. If a sheet loads a view that has a SwiftData @Query, and there is an if statement in the view body, I get the following error when running an iOS targetted SwiftUI app under MacOS 26.1: Set a .modelContext in view's environment to use Query While the view actually ends up loading the correct data, before it does, it ends up re-creating the sqlite store (opening as /dev/null). The strange thing is that this only happens if there is an if statement in the body. The statement need not ever evaluate true, but it causes the issue. Here's an example. It's based on the default xcode new iOS project w/ SwiftData: struct ContentView: View { @State private var isShowingSheet = false var body: some View { Button(action: { isShowingSheet.toggle() }) { Text(Show Sheet) } .sheet(isPresented: $isShowingSheet, onDismiss: didDismiss) { VStack { ContentSheetView() } } } func didDismiss() { } } struct ContentSheetView: View { @Environment(.modelContext) private var modelContext @Query pub
2
0
176
3w
Reply to .glasseffect with multiple date pickers
Thanks for the post and the description. Never seen this, so I don't think is a bug, what version of Xcode are you using? Have you updated to the latest? Could you please provide a list of the macOS, Xcode, and simulator/physical device versions? Do you get the same results with just the relevant code in a small test project? If so, please share a link to your test project. That'll help us better understand what's going on. If you're not familiar with preparing a test project, take a look at Creating a test project. Albert Pascual
  Worldwide Developer Relations.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
3w
Reply to FoundationModel, context length, and testing
Hi I share the code of function that launches the stream query: func lanzarPeticion() async{ defer{👎🔘lanzarConsulta.toggle()} do { let sessionStream = LanguageModelSession(model: modelStream, instructions: instructions) let genOptions = generarSamplingMode(temperatura: temperatura, maxResponseTokens: maxResponseTokens, probabilityThreshold: probabilityThreshold, topK: topK, seed: semilla) let responseStream = sessionStream.streamResponse( to: prompt, options: genOptions) for try await partial in responseStream { withAnimation{ self.respuesta = partial.content t.createPartialTime() } } withAnimation{ t.stop() } } catch { // all the logic for errors } } Clarifications about the code: First of all, English is dominant on code but sometimes use Spanish, my native language, specially when terms overlap swift or framework ones; I have my own emoji rules to avoid characters an improve readability (at this moment I'm indie developer so I set the rules) The defer block is to free the button that launches the request
3w
Xcode 26.1.1 React Native build fails: “Could not delete ios/build” & “Operation not permitted”
I’m building a React Native 0.72.10 iOS app and hitting build errors. Environment: macOS: Apple M4, Sequoia 15.7.2 Xcode: 26.1.1 React Native: 0.72.10 Errors: Could not delete /Users/.../ios/build because it was not created by the build system Unable to write file '/Users/.../ios/build/Pods.build/Debug-iphonesimulator/...': Operation not permitted (Multiple Pods / React Native framework headers affected) What I’ve tried: bash rm -rf ios/build rm -rf ~/Library/Developer/Xcode/DerivedData xattr -w com.apple.xcode.CreatedByBuildSystem true ios/build pod deintegrate && pod install sudo chown -R $(whoami) ios/build Observations: ios/build is recreated automatically. Some files have com.apple.xcode.CreatedByBuildSystem: true. 3.Xcode have Full disk access authorisation. Why does Xcode fail to delete / write to ios/build even though it’s recreated automatically by the build system? Is this caused by Xcode itself, macOS permissions? Any recommended fix or workaroun
1
0
130
3w
Reply to Xcode 26.1.1 React Native build fails: “Could not delete ios/build” & “Operation not permitted”
Thanks for the post, I am not familiar with the third party React Native. You should check with the support resources provided by the 3rd party to get assistance with their software. Unless another developer in the forums has experience with the third-party and can provide assistance. My sole recommendation is to ensure that your macOS is updated to the most recent version, as well as your Xcode. Additionally, I suggest contacting React Native support to inquire if they have encountered similar issues. Good luck. Albert Pascual
  Worldwide Developer Relations.
3w
Reply to Age Range API - Sandbox Testing Available
Xcode Version 26.2 beta 2 (17C5038g) iOS Version 26.2 (23C5044b) do { let response = try await AgeRangeService.shared.isEligibleForAgeFeatures // Handle response if response { print(Eligible for age features) } else { print(Not eligible for age features) } } catch AgeRangeService.Error.notAvailable { print(isEligibleForAgeFeatures not available error) } catch { print(isEligibleForAgeFeatures Unhandled error: (error)) } The above code snippet gets hang at the API call isEligibleForAgeFeatures could you please suggest what is wrong here
Topic: App & System Services SubTopic: General Tags:
3w
Setting Installation Directory correctly is a mystery
Hello I'm wrapping my head around on how to properly set up xcode project to produce a static library ending up in file locations /usr/local/lib/libXXX.a and /usr/local/include/XXX/xxx.h so it can be used Unix style in other projects. If I put under Deployment Deployment Location: YES Installation Build Products Location: / Installation Directory: /usr/local/lib Skip Install: NO I get errors like warning: Stale file '/usr/local/usr/local/include/xxx.h' is located outside of the allowed root paths. and things like error: Cycle inside a single target; building could produce unreliable results. Installation Build Products Location: /usr/local/lib Installation Directory: / I get warning: Stale file '/usr/local/include/xxx.h' is located outside of the allowed root paths. but the library file is not put into /usr/local/lib (note /usr/local/lib and /usr/local/include are owned by my user and writeable) I could write an old style Makefile and have xcode call the makefile but there must be an easier
1
0
52
3w
Reply to Setting Installation Directory correctly is a mystery
Hello I'm wrapping my head around on how to properly set up xcode project to produce a static library Why? file locations /usr/local/lib/libXXX.a and /usr/local/include/XXX/xxx.h so it can be used Unix style in other projects That's not really the way that macOS works. I could write an old style Makefile and have xcode call the makefile but there must be an easier way to do this. What's wrong with a makefile? Xcode is designed to build iOS apps. There is no easy way to make it build open-source style archives and headers. And why should there be? Any open source project would be using standard tools to do this kind of thing. They would never, ever use Xcode. This is for a cross platform development so having it packaged into a Framework would not solve it neither. The Mac and Xcode are not useful for cross-platform development. Just use whatever standard tools fit your technical and social requirements - autotools, CMake, Google-build-engine-du-jour, whatever. Now
3w