Dive into the world of programming languages used for app development.

All subtopics
Posts under Programming Languages topic

Post

Replies

Boosts

Views

Activity

Programming Languages Resources
This topic area is about the programming languages themselves, not about any specific API or tool. If you have an API question, go to the top level and look for a subtopic for that API. If you have a question about Apple developer tools, start in the Developer Tools & Services topic. For Swift questions: If your question is about the SwiftUI framework, start in UI Frameworks > SwiftUI. If your question is specific to the Swift Playground app, ask over in Developer Tools & Services > Swift Playground If you’re interested in the Swift open source effort — that includes the evolution of the language, the open source tools and libraries, and Swift on non-Apple platforms — check out Swift Forums If your question is about the Swift language, that’s on topic for Programming Languages > Swift, but you might have more luck asking it in Swift Forums > Using Swift. General: Forums topic: Programming Languages Swift: Forums subtopic: Programming Languages > Swift Forums tags: Swift Developer > Swift website Swift Programming Language website The Swift Programming Language documentation Swift Forums website, and specifically Swift Forums > Using Swift Swift Package Index website Concurrency Resources, which covers Swift concurrency How to think properly about binding memory Swift Forums thread Other: Forums subtopic: Programming Languages > Generic Forums tags: Objective-C Programming with Objective-C archived documentation Objective-C Runtime documentation Share and Enjoy — Quinn “The Eskimo!” @ Developer Technical Support @ Apple let myEmail = "eskimo" + "1" + "@" + "apple.com"
0
0
854
Oct ’25
FPS not able to do > 30 fps for Pro and ProMax models only
We’re developing an AVFoundation-based video recording app (4K @ 60 fps required for biomechanical analysis). On most devices this works perfectly (iPhone 12/14/15/16 non-Pro models), but on several iPhone Pro models (12 Pro, 13 Pro, 14 Pro, 15 Pro/Pro Max), we consistently get 4K 30 fps recordings—even when the device should support 4K 60 fps on the wide-angle camera. What we observe We configure the session for .hd4K3840x2160. We iterate through AVCaptureDevice.formats and select formats that: have 3840×2160 resolution support ≥60 fps (videoSupportedFrameRateRanges) On some Pro devices, this format search returns no results, even though: The Camera app records 4K60 fine. External references list the wide camera as 4K60 capable. The fallback becomes the device's default 4K30 format, so final files are 3840×2160 @ 30 fps. This happens immediately on app launch (not after heating), so not thermal-related. What we’ve tried Force selecting .builtInWideAngleCamera instead of dual/triple cameras. Disabling HDR (videoHDREnabled = false). Disabling low-light boost. Allowing 59.94 fps formats (in case exact 60.0 isn’t exposed). Logging all videoSupportedFrameRateRanges per format. What we’re seeing in logs On affected Pro devices, the capture device reports only 4K formats with maxFrameRate ≈ 30 fps, despite the hardware being able to do 4K60. Main question Has anyone encountered cases where 4K60 formats are available in the Camera app but not exposed through AVFoundation, especially on Pro models or multi-camera devices? Could HEVC/HDR capability or multi-camera constraints be preventing certain formats from appearing? Are there known conditions where 4K60 formats are hidden unless specific device configuration is applied? Any guidance on reliably locking 4K60 on iPhone Pro models via AVFoundation would be hugely appreciated.
0
0
31
4h
Local Network Discovery Works in Debug but Not in TestFlight (Wi-Fi Speaker Connection Issue)
Hi team, I’m having an issue with my iOS app related to local network communication and connecting to a Wi-Fi speaker. My app works similar to the “4Stream” application. The speaker and the mobile device must be on the same Wi-Fi network so the app can discover and connect to the speaker. What’s happening: When I run the app directly from Xcode in debug mode, everything works perfectly. The speaker gets discovered. The speaker gets connected successfully. The connection flow completes without any problem. But when I upload the same build to TestFlight, the behaviour changes completely. The app gets stuck on the “Connecting…” screen. The speaker is not discovered. But the same code is working fine on Android It never moves forward from that state. So basically: Debug Mode: Speaker is detected and connected properly TestFlight: Stuck at “Connecting…”, speaker does NOT get connected This makes me believe something related to local network access, multicast, Wi-Fi info permissions, or Bonjour discovery is not being applied correctly in the release/TestFlight environment. Below is my current Info.plist and Entitlements file, which already include Local Network Usage, Bonjour services, Location usage for SSID, multicast entitlements, wifi-info, etc. My Info.plist <key>CADisableMinimumFrameDurationOnPhone</key> <true/> <key>CFBundleDevelopmentRegion</key> <string>en</string> <key>CFBundleDisplayName</key> <string>Wanwun</string> <key>CFBundleExecutable</key> <string>$(EXECUTABLE_NAME)</string> <key>CFBundleIdentifier</key> <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> <key>CFBundleInfoDictionaryVersion</key> <string>6.0</string> <key>CFBundleName</key> <string>$(PRODUCT_NAME)</string> <key>CFBundlePackageType</key> <string>APPL</string> <key>CFBundleShortVersionString</key> <string>$(MARKETING_VERSION)</string> <key>CFBundleSignature</key> <string>????</string> <key>CFBundleVersion</key> <string>$(CURRENT_PROJECT_VERSION)</string> <key>LSRequiresIPhoneOS</key> <true/> <!-- Allow HTTP to devices on LAN --> <key>NSAppTransportSecurity</key> <dict> <key>NSAllowsArbitraryLoads</key> <true/> <key>NSExceptionDomains</key> <dict> <key>local</key> <dict> <key>NSExceptionAllowsInsecureHTTPLoads</key> <true/> <key>NSIncludesSubdomains</key> <true/> </dict> <key>localhost</key> <dict> <key>NSExceptionAllowsInsecureHTTPLoads</key> <true/> <key>NSIncludesSubdomains</key> <true/> </dict> </dict> </dict> <!-- Local Network Usage --> <key>NSLocalNetworkUsageDescription</key> <string>This app needs local network access to discover and control your sound system device over Wi-Fi.</string> <!-- Bonjour services for discovery --> <key>NSBonjourServices</key> <array> <string>_http._tcp.</string> <string>_wrtn._tcp.</string> <string>_services._dns-sd._udp.</string> </array> <!-- Location for SSID Permission --> <key>NSLocationWhenInUseUsageDescription</key> <string>This app requires location access to read the connected Wi-Fi information.</string> <!-- Camera / Photos --> <key>NSCameraUsageDescription</key> <string>This app needs camera access to capture attendance photos.</string> <key>NSPhotoLibraryAddUsageDescription</key> <string>This app saves captured photos to your gallery.</string> <key>NSPhotoLibraryUsageDescription</key> <string>This app needs access to your gallery to upload existing images.</string> <!-- Bluetooth --> <key>NSBluetoothAlwaysUsageDescription</key> <string>This app uses Bluetooth to discover nearby sound system devices.</string> <key>NSBluetoothPeripheralUsageDescription</key> <string>This app uses Bluetooth to connect with your sound system.</string> <!-- Launch screen --> <key>UILaunchStoryboardName</key> <string>LaunchScreen</string> <!-- Device Capabilities --> <key>UIRequiredDeviceCapabilities</key> <array> <string>arm64</string> </array> <!-- Orientation --> <key>UISupportedInterfaceOrientations</key> <array> <string>UIInterfaceOrientationPortrait</string> <string>UIInterfaceOrientationLandscapeLeft</string> <string>UIInterfaceOrientationLandscapeRight</string> </array> <key>UIViewControllerBasedStatusBarAppearance</key> <false/> My Entitlements What I need help with: I want to understand why the app behaves correctly in debug mode (where the speaker connects without issues), but the same functionality fails in TestFlight. Is there something additional required for: Local network discovery on TestFlight? Multicast networking? Reading the Wi-Fi SSID? Bonjour, service scanning? Release build / TestFlight network permissions? If any extra entitlement approval, configuration, or specific service type is needed for TestFlight builds, please guide me. Thank you for your help.
0
0
42
4h
Update or remove Ruby 2.6
macOS Tahoe ships with Ruby 2.6.10 which was End Of Life in April 2022 (https://www.ruby-lang.org/en/downloads/branches/). How can I either upgrade it to Ruby 3.4.7 or delete it, so that my mac meets minimum cybersecurity requirements? I use rbenv for more recent versions of Ruby at the moment so don't need any suggestions on how to do add them, I just need rid of the dangerously out of date system Ruby, thanks.
6
0
423
7h
Compiler exception when using Binding and Swift 6
In my code I use a binding that use 2 methods to get and get a value. There is no problem with swift 5 but when I swift to swift 6 the compiler fails : Here a sample example of code to reproduce the problem : `import SwiftUI struct ContentView: View { @State private var isOn = false var body: some View { VStack { Image(systemName: "globe") .imageScale(.large) .foregroundStyle(.tint) Text("Hello, world!") Toggle("change it", isOn: Binding(get: getValue, set: setValue(_:))) } .padding() } private func getValue() -&gt; Bool { isOn } private func setValue(_ value: Bool) { isOn = value } }` Xcode compiler log error : 1. Apple Swift version 6.1.2 (swiftlang-6.1.2.1.2 clang-1700.0.13.5) 2. Compiling with the current language version 3. While evaluating request IRGenRequest(IR Generation for file "/Users/xavierrouet/Developer/TestCompilBindingSwift6/TestCompilBindingSwift6/ContentView.swift") 4. While emitting IR SIL function "@$sSbScA_pSgIeAghyg_SbIeAghn_TR". for &lt;&lt;debugloc at "&lt;compiler-generated&gt;":0:0&gt;&gt;Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var LLVM_SYMBOLIZER_PATH` to point to it): 0 swift-frontend 0x000000010910ae24 llvm::sys::PrintStackTrace(llvm::raw_ostream&amp;, int) + 56 1 swift-frontend 0x0000000109108c5c llvm::sys::RunSignalHandlers() + 112 2 swift-frontend 0x000000010910b460 SignalHandler(int) + 360 3 libsystem_platform.dylib 0x0000000188e60624 _sigtramp + 56 4 libsystem_pthread.dylib 0x0000000188e2688c pthread_kill + 296 5 libsystem_c.dylib 0x0000000188d2fc60 abort + 124 6 swift-frontend 0x00000001032ff9a8 swift::DiagnosticHelper::~DiagnosticHelper() + 0 7 swift-frontend 0x000000010907a878 llvm::report_fatal_error(llvm::Twine const&amp;, bool) + 280 8 swift-frontend 0x00000001090aef6c report_at_maximum_capacity(unsigned long) + 0 9 swift-frontend 0x00000001090aec7c llvm::SmallVectorBase::grow_pod(void*, unsigned long, unsigned long) + 384 10 swift-frontend 0x000000010339c418 (anonymous namespace)::SyncCallEmission::setArgs(swift::irgen::Explosion&amp;, bool, swift::irgen::WitnessMetadata*) + 892 11 swift-frontend 0x00000001035f8104 (anonymous namespace)::IRGenSILFunction::visitFullApplySite(swift::FullApplySite) + 4792 12 swift-frontend 0x00000001035c876c (anonymous namespace)::IRGenSILFunction::visitSILBasicBlock(swift::SILBasicBlock*) + 2636 13 swift-frontend 0x00000001035c6614 (anonymous namespace)::IRGenSILFunction::emitSILFunction() + 15860 14 swift-frontend 0x00000001035c2368 swift::irgen::IRGenModule::emitSILFunction(swift::SILFunction*) + 2788 15 swift-frontend 0x00000001033e7c1c swift::irgen::IRGenerator::emitLazyDefinitions() + 5288 16 swift-frontend 0x0000000103573d6c swift::IRGenRequest::evaluate(swift::Evaluator&amp;, swift::IRGenDescriptor) const + 4528 17 swift-frontend 0x00000001035c15c4 swift::SimpleRequest&lt;swift::IRGenRequest, swift::GeneratedModule (swift::IRGenDescriptor), (swift::RequestFlags)17&gt;::evaluateRequest(swift::IRGenRequest const&amp;, swift::Evaluator&amp;) + 180 18 swift-frontend 0x000000010357d1b0 swift::IRGenRequest::OutputType swift::Evaluator::getResultUncached&lt;swift::IRGenRequest, swift::IRGenRequest::OutputType swift::evaluateOrFatalswift::IRGenRequest(swift::Evaluator&amp;, swift::IRGenRequest)::'lambda'()&gt;(swift::IRGenRequest const&amp;, swift::IRGenRequest::OutputType swift::evaluateOrFatalswift::IRGenRequest(swift::Evaluator&amp;, swift::IRGenRequest)::'lambda'()) + 812 19 swift-frontend 0x0000000103576910 swift::performIRGeneration(swift::FileUnit*, swift::IRGenOptions const&amp;, swift::TBDGenOptions const&amp;, std::__1::unique_ptr&lt;swift::SILModule, std::__1::default_deleteswift::SILModule&gt;, llvm::StringRef, swift::PrimarySpecificPaths const&amp;, llvm::StringRef, llvm::GlobalVariable**) + 176 20 swift-frontend 0x0000000102f61af0 generateIR(swift::IRGenOptions const&amp;, swift::TBDGenOptions const&amp;, std::__1::unique_ptr&lt;swift::SILModule, std::__1::default_deleteswift::SILModule&gt;, swift::PrimarySpecificPaths const&amp;, llvm::StringRef, llvm::PointerUnion&lt;swift::ModuleDecl*, swift::SourceFile*&gt;, llvm::GlobalVariable*&amp;, llvm::ArrayRef&lt;std::__1::basic_string&lt;char, std::__1::char_traits, std::__1::allocator&gt;&gt;) + 156 21 swift-frontend 0x0000000102f5d07c performCompileStepsPostSILGen(swift::CompilerInstance&amp;, std::__1::unique_ptr&lt;swift::SILModule, std::__1::default_deleteswift::SILModule&gt;, llvm::PointerUnion&lt;swift::ModuleDecl*, swift::SourceFile*&gt;, swift::PrimarySpecificPaths const&amp;, int&amp;, swift::FrontendObserver*) + 2108 22 swift-frontend 0x0000000102f5c0a8 swift::performCompileStepsPostSema(swift::CompilerInstance&amp;, int&amp;, swift::FrontendObserver*) + 1036 23 swift-frontend 0x0000000102f5f654 performCompile(swift::CompilerInstance&amp;, int&amp;, swift::FrontendObserver*) + 1764 24 swift-frontend 0x0000000102f5dfd8 swift::performFrontend(llvm::ArrayRef&lt;char const*&gt;, char const*, void*, swift::FrontendObserver*) + 3716 25 swift-frontend 0x0000000102ee20bc swift::mainEntry(int, char const**) + 5428 26 dyld 0x0000000188a86b98 start + 6076 Using Xcode 16.4 / Mac OS 16.4
4
0
437
2d
App mysteriously crashing in CFNetwork.LoaderQ queue
I’m stuck with repeated production crashes in my SwiftUI app and I can’t make sense of the traces on my own. The symbolicated reports show the same pattern: Crash on com.apple.CFNetwork.LoaderQ with EXC_BAD_ACCESS / PAC failure Always deep in CFNetwork, most often in URLConnectionLoader::loadWithWhatToDo(NSURLRequest*, _CFCachedURLResponse const*, long, URLConnectionLoader::WhatToDo) No frames from my code, no sign of AuthManager or tokens. What I’ve tried: Enabled Address Sanitizer, Malloc Scribble, Guard Malloc, Zombies. Set CFNETWORK_DIAGNOSTICS=3 and collected Console logs. Stress-tested the app (rapid typing, filter switching, background/foreground, poor network with Network Link Conditioner). Could not reproduce the crash locally. So far: Logs show unrelated performance faults (I/O on main thread, CLLocationManager delegate), but no obvious CFNetwork misuse. My suspicion is a URLSession lifetime or delegate/auth-challenge race, but I can’t confirm because I can’t trigger it. Since starting this investigation, I also refactored some of my singletons into @State/@ObservedObject dependencies. For example, my app root now wires up AuthManager, BackendService, and AccountManager (where API calls happen using async/await) as @State properties: @State var authManager: AuthManager @State var accountManager: AccountManager @State var backendService: BackendService init() { let authManager = AuthManager() self._authManager = .init(wrappedValue: authManager) let backendService = BackendService(authManager: authManager) self._backendService = .init(wrappedValue: backendService) self._accountManager = .init(wrappedValue: AccountManager(backendService: backendService)) } I don’t know if this refactor is related to the crash, but I am including it to be complete. Apologies that I don’t have a minimized sample project — this issue seems app-wide, and all I have are the crash logs. Request: Given the crash location (URLConnectionLoader::loadWithWhatToDo), can Apple provide guidance on known scenarios or misuses that can lead to this crash? Is there a way to get more actionable diagnostics from CFNetwork beyond CFNETWORK_DIAGNOSTICS to pinpoint whether it’s session lifetime, cached response corruption, or auth/redirect? Can you also confirm whether my dependency setup above could contribute to URLSession or backend lifetime issues? I can’t reliably reproduce the crash, and without Apple’s insight the stack trace is effectively opaque to me. Thanks for your time and help. Happy to send multiple symbolicated crash logs at request. Thanks for any help. PS. Including 2 of many similar crash logs. Can provide more if needed. Atlans-2025-07-29-154915_symbolicated (cfloader).txt Atlans-2025-08-08-124226_symbolicated (cfloader).txt
5
0
3.5k
6d
NotificationCenter Crash On iOS 18+ Swift6.2
After switching our iOS app project from Swift 5 to Swift 6 and publishing an update, we started seeing a large number of crashes in Firebase Crashlytics. The crashes are triggered by NotificationCenter methods (post, addObserver, removeObserver) and show the following error: BUG IN CLIENT OF LIBDISPATCH: Assertion failed: Block was expected to execute on queue [com.apple.main-thread (0x1f9dc1580)] All scopes to related calls are already explicitly marked with @MainActor. This issue never occurred with Swift 5, but appeared immediately after moving to Swift 6. Has anyone else encountered this problem? Is there a known solution or workaround? Thanks in advance!
2
1
1.4k
1w
Async function doesn’t see external changes to an inout Bool in Release build
Title Why doesn’t this async function see external changes to an inout Bool in Release builds (but works in Debug)? Body I have a small helper function that waits for a Bool flag to become true with a timeout: public func test(binding value: inout Bool, timeout maximum: Int) async throws { var count = 0 while value == false { count += 1 try await Task.sleep(nanoseconds: 0_100_000_000) if value == true { return } if count > (maximum * 10) { return } } } I call like this: var isVPNConnected = false adapter.start(tunnelConfiguration: tunnelConfiguration) { [weak self] adapterError in guard let self = self else { return } if let adapterError = adapterError { } else { isVPNConnected = true } completionHandler(adapterError) } try await waitUntilTrue(binding: &isVPNConnected, timeout: 10) What I expect: test should keep looping until flag becomes true (or the timeout is hit). When the second task sets flag = true, the first task should see that change and return. What actually happens: In Debug builds this behaves as expected: when the second task sets flag = true, the loop inside test eventually exits. In Release builds the function often never sees the change and gets stuck until the timeout (or forever, depending on the code). It looks like the while value == false condition is using some cached value and never observes the external write. So my questions are: Is the compiler allowed to assume that value (the inout Bool) does not change inside the loop, even though there are await suspension points and another task is mutating the same variable? Is this behavior officially “undefined” because I’m sharing a plain Bool across tasks without any synchronization (actors / locks / atomics), so the debug build just happens to work? What is the correct / idiomatic way in Swift concurrency to implement this kind of “wait until flag becomes true with timeout” pattern? Should I avoid inout here completely and use some other primitive (e.g. AsyncStream, CheckedContinuation, Actor, ManagedAtomic, etc.)? Is there any way to force the compiler to re-read the Bool from memory each iteration, or is that the wrong way to think about it? Environment (if it matters): Swift: [fill in your Swift version] Xcode: [fill in your Xcode version] Target: iOS / macOS [fill in as needed] Optimization: default Debug vs. Release settings I’d like to understand why Debug vs Release behaves differently here, and what the recommended design is for this kind of async waiting logic in Swift.
2
0
1.1k
2w
Adding days to a date using the result of a division operation
var testTwo: Double = 0 testDouble = 80 testTwo = 200 var testThree: Int = 0 testThree = Int(testTwo/testDouble) var testDate: Date = .now var dateComponent = DateComponents() dateComponent.day = testThree var newDate: Date = Calendar.current.date(byAdding: dateComponentwith a thread error , to: testDate)! This code works in a playground. However, when I try to use it in Xcode for my app it fails with the following error: Thread 1: Fatal error: Double value cannot be converted to Int because it is either infinite or NaN I printed the value being converted to Int and it was not NAN or infinite.
2
0
735
2w
Basic c++ main xcodeproj call to swift struct
I can't find any simple c++ xcodeproj call to swift struct using modern c++ swift mix. there is the fibonacci example that is swift app call to c++. Base on fibonacci example I create new simple project and fail to build it with error when I try to include #include <SwiftMixTester/SwiftMixTester-Swift.h> What is wrong? Is it the right place to ask this? Any work project link? Xcode 26.
1
0
858
Oct ’25
Basic c++xcodeproj call to swift code
I have c++ macOs app(Xcode +14) and I try to add call to swift code. I can't find any simple c++ xcodeproj call to swift code. I create new simple project and fail to build it with error when I try to include #include <SwiftMixTester/SwiftMixTester-Swift.h>: main.m:9:10: error: 'SwiftMixTester/SwiftMixTester-Swift.h' file not found (in target 'CppCallSwift' from project 'CppCallSwift') note: Did not find header 'SwiftMixTester-Swift.h' in framework 'SwiftMixTester' (loaded from '/Users/yanivsmacm4/Library/Developer/Xcode/DerivedData/CppCallSwift-exdxjvwdcczqntbkksebulvfdolq/Build/Products/Debug') . Please help.
5
0
398
Oct ’25
App sometimes crashes when inserting String into Set with assertion ELEMENT_TYPE_OF_SET_VIOLATES_HASHABLE_REQUIREMENTS
Xcode downloaded a crash report for my app that crashed when trying to insert a String into a Set<String>. Apparently there was an assertion failure ELEMENT_TYPE_OF_SET_VIOLATES_HASHABLE_REQUIREMENTS. I assume that this assertion failure happened because the hash of the new element didn't match the hash of an equal already inserted element, but regardless, I don't understand how inserting a simple string could trigger this assertion. Here is essentially the code that leads to the crash. path is any file system directory, and basePath is a directory higher in the hierarchy, or path itself. var scanErrorPaths = Set<String>() func main() { let path = "/path/to/directory" let basePath = "/path" let fileDescriptor = open(path, O_RDONLY) if fileDescriptor < 0 { if (try? URL(fileURLWithPath: path, isDirectory: false).checkResourceIsReachable()) == true { scanErrorPaths.insert(path.relativePath(from: basePath)!) return } } extension String { func relativePath(from basePath: String) -> String? { if basePath == "" { return self } guard let index = range(of: basePath, options: .anchored)?.upperBound else { return nil } return if index == endIndex || basePath == "/" { String(self[index...]) } else if let index = self[index...].range(of: "/", options: .anchored)?.upperBound { String(self[index...]) } else { nil } } } crash.crash
7
0
775
Oct ’25
Attrubute can only be applied to types not declarations
Error: "Attrubute can only be applied to types not declarations" on line 2 : @unchecked @unchecked enum ReminderRow : Hashable, Sendable { case date case notes case time case title var imageName : String? { switch self { case .date: return "calendar.circle" case .notes: return "square.and.pencil" case .time: return "clock" default : return nil } } var image : UIImage? { guard let imageName else { return nil } let configuration = UIImage.SymbolConfiguration(textStyle: .headline) return UIImage(systemName: imageName, withConfiguration: configuration) } var textStyle : UIFont.TextStyle { switch self { case .title : return .headline default : return .subheadline } } }
1
0
289
Oct ’25
"_swift_coroFrameAlloc", 报错
Undefined symbols for architecture arm64: "_swift_coroFrameAlloc", referenced from: NvMobileCore.Constraint.isActive.modify : Swift.Bool in NvMobileCore[5] NvMobileCore.Constraint.isActive.modify : Swift.Bool in NvMobileCore[5] NvMobileCore.NvMobileCoreManager.delegate.modify : NvMobileCore.NvPublicInterface? in NvMobileCore[53] NvMobileCore.NvMobileCoreManager.delegate.modify : NvMobileCore.NvPublicInterface? in NvMobileCore[53] NvMobileCore.NvMobileCoreManager.language.modify : Swift.String in NvMobileCore[53] NvMobileCore.NvMobileCoreManager.language.modify : Swift.String in NvMobileCore[53] ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation)
2
0
348
Oct ’25
Archive Failing for iPhoneOS SDK in Xcode 26
When i am trying to archive a framework for ML, using below command: xcodebuild -workspace "./src/MLProject.xcworkspace" -configuration "Release" -sdk "iphoneos" -archivePath "./gen/out/Archives/Release-iphoneos/MLProject" -scheme "MLProject" -derivedDataPath "./gen/out/" archive BUILD_LIBRARY_FOR_DISTRIBUTION=YES SKIP_INSTALL=NO The same command used to work fine on Xcode 16.4. Attached is the detailed error MLProject_Archive_failure.txt
1
1
100
Oct ’25
Beginner’s question on learning philosophy.
Hello Everyone! I started programming 6 months ago and started Swift / IOS last month. My learning so far has mainly been with Python. I learned a lot of the package ‘SQLAlchemy’, which has very ‘example based’ documentation. If I wanted to learn how to make a many to many relationship, there was a demonstration with code. But going into Swift and Apple packages, I notice most of the documentation is definitions of structures, modifiers, functions, etc. I wanted to make the equivalent of python ‘date times’ in my swift app. I found the section in the documentation “Foundation->Dates & Times”, but I couldn’t figure how to use that in my code. I assume my goal should not be to memorize every Swift and apple functionality by memory to be an app developer. So I would appreciate advice on how to approach this aspect of learning programming.
2
0
453
Oct ’25
Error `Type of expression is ambiguous without a type annotation` when trying to create a Task.
Hi, I've got this view model that will do a search using a database of keywords. It worked fine when the SearchEngine wasn't an actor but a regular class and the SearchResult wasn't a Sendable. But when I changed them, it returned Type of expression is ambiguous without a type annotation error at line 21 ( searchTask = Task {). What did I do wrong here? Thanks. protocol SearchableEngine: Actor { func searchOrSuggest(from query: String) -> SearchResult? func setValidTitles(_ validTitles: [String]) } @MainActor final class SearchViewModel: ObservableObject { @Published var showSuggestion: Bool = false @Published var searchedTitles: [String] = [] @Published var suggestedKeyword: String? = nil private var searchTask: Task<Void, Never>? private let searchEngine: SearchableEngine init(searchEngine: SearchableEngine) { self.searchEngine = searchEngine } func search(_ text: String) { searchTask?.cancel() searchTask = Task { guard !Task.isCancelled else { return } let searchResult = await searchEngine.searchOrSuggest(from: text) ?? .notFound guard !Task.isCancelled else { return } await MainActor.run { switch searchResult { case let .searchItems(_, items): showSuggestion = false searchedTitles = items.map(\.title) suggestedKeyword = nil case let .suggestion(keyword, _, items): showSuggestion = true searchedTitles = items.map(\.title) suggestedKeyword = keyword case .notFound: showSuggestion = false searchedTitles = [] suggestedKeyword = nil } } } } }
1
0
526
Oct ’25