Search results for

DTiPhoneSimulatorErrorDomain Code 2

158,639 results found

Post

Replies

Boosts

Views

Activity

Reply to C function in library code gets stripped when distributed
After much much tweaking and testing. I finally called the C function from another place inside the library and this did work. It's only when called from the dylib that it fails. The symbol _say_hello_world was being stripped from the binary's symbol table during the release build. The function code existed in the binary (verified via dSYM), but Xcode's default Strip Style = All Symbols removes symbol names from the export table. Since dlsym() looks up symbols by name, it couldn't find the function. In the app's Xcode project (not Package.swift): Build Settings → Strip Style → Non-Global Symbols This preserves global symbols (like _say_hello_world) in the binary's symbol table while still stripping local/debug symbols. Limitation This setting cannot be controlled from Package.swift. SPM package authors must document that users need to set STRIP_STYLE = non-global in their app's build settings when using dlsym() with statically linked code. Basically, this is a dead end trying to keep the glo
Topic: Programming Languages SubTopic: General Tags:
1w
Using @Environment with TabView
Let me ask the general question first, then explain the context... Each Tab of a TabView defines a separate View hierarchy. (I'm assuming that the root view of each Tab defines its own NavigationStack.) Since an @Environment is supposed to serve data to the child views in its view hierarchy, does this mean that it is possible to define Environments in each tab's root view with the same name (i.e. key) but different values? (I.e., I want a subview to access an environment value for the current view hierarchy without requiring that the subview have any knowledge of which hierarchy it is being called from.) The actual use case has to do with using @Environment in a tabbed application to inject a router in subviews. (Each Tab has its own NavigationStack and its own NavigationPath.) I have an @Observable router class which manages a NavigationPath.. The root view of each Tab in the application has its own instance of that router object (and hence, it's own NavigationPath). I want to inject that router into all of
2
0
158
1w
How to properly localize AppIntent dialogs for Siri?
Hi! I have defined the following app intent. It returns a result with a dialog to confirm that the intent has been executed. Naturally, that dialog needs to be localized properly. But the String interpolation with the provided format doesn't do that. I specified wide for the width parameter and expect spelled-out unit names. However, in the textual output, Siri always uses the abbreviated unit (e.g. min or s), in all languages I tested. In the audio output, Siri says minutes in English where the textual representation is min. In German, Siri says min, so it basically reads the textual representation aloud and that's not quite understandable to the user. struct StartTimerIntent: AppIntent { static let title: LocalizedStringResource = Start New Timer static var description = IntentDescription(Starts a timer with a custom duration.) @Parameter(title: Duration, description: The duration of the timer.) var duration: Measurement func perform() async throws -> some IntentResult & ProvidesDialog { // [code
1
0
143
1w
DisplayRepresentation.Image(systemName:tintColor:) ignores or misapplies tintColor since iOS 18
DisplayRepresentation.Image(systemName:tintColor:symbolConfiguration:) no longer applies the provided tintColor reliably since iOS 18. Observed behavior by OS version: iOS 17: SF Symbol tint is applied consistently as expected. iOS 18: SF Symbol tint is inconsistent and sometimes appears with incorrect or seemingly random colors instead of the provided tintColor. iOS 26: SF Symbol is rendered without any tint (default monochrome), completely ignoring the provided tintColor. This appears to be a regression in how App Intents renders DisplayRepresentation.Image with tinting across OS versions. iOS17.5: iOS 18.6: iOS26: Code: import AppIntents import UIKit struct CategoryEntity: AppEntity, Hashable { var id: Category.ID var name: String var icon: Int? var color: Int? var parentCategoryName: String? init(from category: Category) { self.id = category.id self.name = category.name self.icon = category.icon self.color = category.parent?.color ?? category.color self.parentCategoryName = category.parent?.name
1
0
226
1w
ExternalPurchase.canPresent returns false despite complete configuration (iOS 17.4+, EU)
I'm implementing the External Purchase API in my iOS app for EU DMA compliance, but ExternalPurchase.canPresent always returns false despite having completed all configuration steps. Configuration: Alternative Terms Addendum for Apps in the EU: Signed on January 3, 2026 Entitlement: com.apple.developer.storekit.external-purchase.enabled (enabled in Xcode) Provisioning profile: Regenerated with new capability Info.plist: SKExternalPurchase array with all 27 EU country codes Test device: Physical iPhone, Belgium App Store, iOS 18.2 Code: guard await ExternalPurchase.canPresent else { print(Cannot present - canPresent is false) return } Debug output shows canPresent is consistently false. Questions: Is there an activation delay after signing the Alternative Terms Addendum? Does the API only work in TestFlight/Production builds (not development)? Is additional configuration required beyond entitlement + Info.plist + addendum? Any guidance would be appreciated.
0
0
91
1w
Listing files of a background asset
Is there a way to enumerate all files within a folder of an asset pack or just all files in general? My application is using the Apple demo code to load a file from an Apple hosted asset pack: let descriptor = try AssetPackManager.shared.descriptor(for: NAV/NavData.db3) defer { try descriptor.close() } if let path = path(for: descriptor) { self.database = try Database(path: path) } As my Navigation Data is updated each month with an updated asset pack I would like to have the name of the .db3 file reflect the current data cycle (e.g. NAV2601.db3, NAV2602.db3, ...) Ideally I would like to iterate over all files within the NAV folder of the current asset pack and pick the most recent one. Unfortunately, neither the AssetPackManager nor the AssetPack object seem to include an API for this. It would be cool to have something like: let files = try AssetPackManager.shared.files(for: NAV/) for file in files { //Check and load }
1
0
97
1w
Apple terminated my only developer account, holding $30K, no explanation after multiple appeals. I have a family to support.
I'm a full-time indie iOS developer. This is my family's only income. On December 19th, Apple terminated my developer account with zero explanation, and they're holding $30,000 in earnings. Background Solo developer, working 12+ hours/day Five apps on the App Store This is my family's only source of income What happened December 19, 2025: Account terminated with this message: Upon further review of the activity associated with your Apple Developer Program membership, it's been determined that your membership, or a membership associated with your account, has been used for dishonest or fraudulent activity, in violation of the Apple Developer Program License Agreement. Given the severity of the identified issues, your account has been flagged for removal. No specifics. No evidence. No prior warnings. What I've tried ✅ Appealed immediately - rejected with template response ✅ Asked for ANY details about what I allegedly did - no response What I actually did (trying to figure out what triggered this) Used expedite
1
0
123
1w
Swift Playgrounds macOS repeatedly asks “My App would like to access data from other apps”
Environment: Swift Playgrounds (macOS) SwiftUI App Preview macOS version: 26.2 (25C56) Issue: In Swift Playgrounds on macOS, the app repeatedly shows the system permission dialog: “My App would like to access data from other apps. Keeping app data separate makes it easier to manage your privacy and security.” Steps to Reproduce: Create a new SwiftUI app in Swift Playgrounds. Run the SwiftUI App Preview. When the permission dialog appears, click “Allow”. Expected Result: The permission should be granted once and persist, allowing the preview to continue normally. Actual Result: After clicking “Allow”, the SwiftUI App Preview crashes and restarts. When the preview restarts, the same permission dialog appears again. This repeats indefinitely, creating a loop. Notes: This occurs even when no explicit file system or inter-app data access code is written. The permission choice does not appear to persist between preview restarts. Question: Is this a known limitation of Swift Playgrounds sandboxing or SwiftU
2
0
114
1w
Errors with PerfPowerTelemetryClientRegistrationService and PPSClientDonation when running iOS application in Xcode
I've suddenly started seeing hundreds of the same block of four error messages (see attached image) when running my app on my iOS device through Xcode. I've tried Cleaning the Build folder, but I keep seeing these messages in the console but can't find anything about them. Phone is running iOS 26.1. Xcode is at 16.4. Mac is on Sequoia 15.5. The app is primarily a MapKit SwiftUI based application. Messages below: Connection error: Error Domain=NSCocoaErrorDomain Code=4099 The connection to service named com.apple.PerfPowerTelemetryClientRegistrationService was invalidated: Connection init failed at lookup with error 159 - Sandbox restriction. UserInfo={NSDebugDescription=The connection to service named com.apple.PerfPowerTelemetryClientRegistrationService was invalidated: Connection init failed at lookup with error 159 - Sandbox restriction.} (+[PPSClientDonation isRegisteredSubsystem:category:]) Permission denied: Maps / SpringfieldUsage (+[PPSClientDonation sendEventWithIdentifier:payload:]) Invalid
2
0
170
1w
Reply to C function in library code gets stripped when distributed
Here is a more step by step breakdown of the problem I have a iOS library that exposes a C function. This function is marked with default visibility and used via attribute tags to prevent the compiler/linker from stripping it #ifdef __cplusplus #define DYLIB_EXPORT extern C __attribute__((visibility(default))) __attribute__((used)) #else #define DYLIB_EXPORT __attribute__((visibility(default))) __attribute__((used)) #endif DYLIB_EXPORT bool say_hello_world(); #import helper_functions.h #import bool say_hello_world() { NSLog(@Hello WORLD 🟢!); return true; } From a dynamic library, called sdk, I want to call this function. In this example it's a Rust lib unsafe extern C { fn say_hello_world() -> bool; } #[unsafe(no_mangle)] extern C fn sdk_init() -> i32 { unsafe { say_hello_world(); } return 0; } When the app is compiled and launched from Xcode (either on debug or release schemes) then this works, the following snippet works and prints the hello WORLD message: #import OpacityObjCWrapper.h #import helper
Topic: Programming Languages SubTopic: General Tags:
1w
Task cancellation behavior
Hi everyone, I believe this should be a simple and expected default behavior in a real-world app, but I’m unable to make it work: I have a View (a screen/page in this case) that calls an endpoint using async/await. If the endpoint hasn’t finished, but I navigate forward to a DetailView, I want the endpoint to continue fetching data (i.e., inside the @StateObject ViewModel that the View owns). This way, when I go back, the View will have refreshed with the fetched data once it completes. If the endpoint hasn’t finished and I navigate back to the previous screen, I want it to be canceled, and the @StateObject ViewModel should be deinitialized. I can achieve 1 and 3 using the .task modifier, since it automatically cancels the asynchronous task when the view disappears: view .task { await vm.getData() } I can achieve 1 and 2 using a structured Task in the View (or in the ViewModel, its the same behavior), for example: .onFirstAppearOnly { Task { away vm.getData() } } onFirstAppearOnly is a custom modifie
0
0
139
1w
Reply to Infinite loop getting "_dismiss changed"
I have managed to reproduce unwanted _dismiss changed behavior in the strangest way possible. If you add ANY StoreKit code then on swiping up (i.e. exiting the app) and returning it will produce a bunch of changes. In my app, this was an extremely disruptive bug as it would cause my WebView to reset, losing all state. Here's the code: import SwiftUI import StoreKit struct ContentView: View { @Environment(.dismiss) private var dismiss var body: some View { let _ = Self._printChanges() VStack { Image(systemName: globe) .imageScale(.large) .foregroundStyle(.tint) Text(Hello, world!) // Any StoreKit code causes `_dismiss changed.`. Comment the line below and it no longer happens ProductView(id: testing) } .padding() // Adding a View Modifier like .storeProductTask or .currentEntitlementTask also produces the issue } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
1w