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
782
3w
Apple-hosted managed assets
Hi, anyone managed to make this work? https://developer.apple.com/documentation/backgroundassets Trying for past few days and can't make it work. Following their official documentation, also this video https://www.youtube.com/watch?v=M3jpgZrB1uo, but it seems I am stuck at: try await AssetPackManager.shared.ensureLocalAvailability(of: assetPack) What I did: Manifest files created, info.plist configured, asset pack created and uploaded to appstoreconnect via transporter, successfully assigned to app and ready for internal testing. Added to my code: let assetPack = try await AssetPackManager.shared.assetPack(withID: "Tutorial") try await AssetPackManager.shared.ensureLocalAvailability(of: assetPack) let videoData = try AssetPackManager.shared.contents(at: "Videos/Introduction.m4v") but no luck at all.... is anywhere any demo project available to download to compare with my project?
0
0
24
2h
Performance issues when using the Network API used to create a web server
Hello, We use the Network API in our macOS ObjectiveC applications to create a small web server. With macOS Sequoia or Tahoe (not with Sonoma), downloading files from another computer using the built-in ethernet port is way too slow. Steps to reproduce: Computer A (using macOS Tahoe or Sonoma), run an application using the Network APIs to create a webserver Make sure that this computer connects to the network using the Ethernet port, there is no issue when using WiFi On computer B, make an HTTP request to download a 20MB file => it will take about 30 seconds to download => way too slow... We tested with: if on computer A you run a web server using the GCD API instead of Network, it takes 0.2 seconds to download the file => no issue on computer A disable TSO, it improves the results, but that's not a long term solution as it doesn't hold when rebooting I can provide sample code to demonstrate this if needed. This is a new issue as it's been a while we use that code, and only noticed it recently, and macOS Sonoma is not impacted. Thank you for the help you can provide. Pierre
1
0
155
4h
Missing Apple-Hosted Background Assets info
After combing the forums and release nodes, here are some extra notes to help other developers using Apple-Hosted Background Assets. I don't promise I got this perfect, but it may help direct you. AssetPack.Status is an OptionSet (not an enum!) - Critical API detail missing from guide It's a bitmask where values can be combined 2⁰ (1) = available to download 2¹ (2) = update available 2² (4) = up to date 2⁶ (64) = downloaded Example: status value 69 = 0b1000101 = available + up to date + downloaded Use .contains() method to check specific flags AssetPack.version property - Undocumented feature Auto-assigned by App Store Connect for Apple-hosted packs Increments with each upload of same asset pack ID No file deduplication across asset packs Same file in two packs = counts twice toward 200GB limit Best practice: create separate pack for shared files Shared namespace path requirements Asset pack ID is NOT part of file path Each file must have unique relative path across ALL app's asset packs Example: Foo/10/239/414.png and Bar/10/239/414.png are distinct and won't collide Additional url(for:) bugs beyond iOS 26.1 fix iOS 26 Beta 5: "item with same name already exists" error Workaround: Request URL for directory, then manually append filename TestFlight-only availability - Major limitation not mentioned! Apple-hosted packs currently ONLY work for internal testers on TestFlight or from App Store. Won't work from Xcode until "later this year" HTTP 400 errors expected for non-TestFlight installs ba-serve port workaround URL override port bug exists on multiple device types Use ba-serve -p 443 instead of custom ports
0
0
32
6h
How to modify mouse movements, like acceleration, increasing pointer speed, and more on macOS
Hi Guys, I've been wanting to make a bettermouse-like tool for some time now, but I can't figure out how to modify mouse events to do it. I've managed to get mouse events, like the cursor moving, but I can't seem to modify them. What I try either creates a feedback loop, does absolutely nothing, or makes the cursor have a seizure. Any help is appreciated!
0
0
33
8h
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
573
2d
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
209
3d
"_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
147
3d
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
68
5d
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
427
1w
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
503
2w
What is the future of Objective-C?
Will Apple continue to support it, or will we wake up one day to find that Swift is the only viable language?It's a serious question. Careers depend on it. I don't accept the "No comment" approach that Apple usually takes. It's cruel.I'm willing to put the time into learning Swift if I have to. I'm not going to do it if I don't. I want to know.Frank
23
1
33k
3w
Undefined symbol
Is anyone have this problem on xcode 26 ? Undefined symbol: _swift_FORCE_LOAD$_swiftCompatibility50 Undefined symbol: _swift_FORCE_LOAD$_swiftCompatibility51 Undefined symbol: _swift_FORCE_LOAD$_swiftCompatibility56 Undefined symbol: _swift_FORCE_LOAD$_swiftCompatibilityConcurrency Undefined symbol: _swift_FORCE_LOAD$_swiftCompatibilityDynamicReplacements
1
1
1.3k
Sep ’25
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
4
0
3.1k
Sep ’25
MPMediaItemPropertyArtwork crashes on Swift 6
Hey all! in my personal quest to make future proof apps moving to Swift 6, one of my app has a problem when setting an artwork image in MPNowPlayingInfoCenter Here's what I'm using to set the metadata func setMetadata(title: String? = nil, artist: String? = nil, artwork: String? = nil) async throws { let defaultArtwork = UIImage(named: "logo")! var nowPlayingInfo = [ MPMediaItemPropertyTitle: title ?? "***", MPMediaItemPropertyArtist: artist ?? "***", MPMediaItemPropertyArtwork: MPMediaItemArtwork(boundsSize: defaultArtwork.size) { _ in defaultArtwork } ] as [String: Any] if let artwork = artwork { guard let url = URL(string: artwork) else { return } let (data, response) = try await URLSession.shared.data(from: url) guard (response as? HTTPURLResponse)?.statusCode == 200 else { return } guard let image = UIImage(data: data) else { return } nowPlayingInfo[MPMediaItemPropertyArtwork] = MPMediaItemArtwork(boundsSize: image.size) { _ in image } } MPNowPlayingInfoCenter.default().nowPlayingInfo = nowPlayingInfo } the app crashes when hitting MPMediaItemPropertyArtwork: MPMediaItemArtwork(boundsSize: defaultArtwork.size) { _ in defaultArtwork } or nowPlayingInfo[MPMediaItemPropertyArtwork] = MPMediaItemArtwork(boundsSize: image.size) { _ in image } commenting out these two make the app work again. Again, no clue on why. Thanks in advance
6
0
2.9k
Sep ’25
Customization in Swift ArgumentParser's help command and error output
Hello I want to implement customisation to swift argumentparser, Here are following changes want to do it in my cli changing default footer present in help command output currently help command output coming like this OVERVIEW: clisample USAGE: clisample <subcommand> OPTIONS: --version show the version. -h, --help show the help. SUBCOMMANDS: logs (default) Export logs for clisample processes. See 'clisample --help' for more information.' so instead of See 'clisample --help' for more information.' I want my own string For more details, run 'clisample help <subcommand>' customise error string getting from validation error Error: Missing value for '-t <time>' Help: -t <time> Time window (e.g. 10h, 30m, 2d). Usage: clisample logs --time <time> See 'clisample logs --help' for more information. so I want error output with example and customised footer, like this Error: Missing value for '-t <time>' Help: -t <time> Time window (e.g. 10h, 30m, 2d). Usage: clisample logs --time <time> Example: clisample logs -t 5m For more details, run 'clisample help <subcommand>' Is this changes possible from anyway?
1
0
499
Sep ’25
Swift Package Manager – Support for Multiple Targets with Distinct Localization Files
I am an SDK provider working with Swift Package Manager (SPM) to deliver libraries for iOS developers. My SDK currently uses SPM targets to modularize functionality. However, SPM enforces strict resource bundling, which prevents me from efficiently offering multiple targets—each with a different set of localization files—in a single package. Current Limitation: When multiple SPM targets share the same source and resource directory but require distinct sets of .lproj localization folders (for app size or client requirements), SPM raises “overlapping sources” errors. The only workaround is to manually split resource directories or have clients prune localizations post-build, which is inefficient and error-prone. Feature Request: Please consider adding native support in Swift Package Manager for: Defining multiple targets within a single package that can process overlapping source/resource directories, Each target specifying a distinct subset of localization resource files via the exclude or a new designated parameter, Enabling efficient modular delivery of SDKs to clients needing different localization payloads, without redundant resource duplication or error-prone manual pruning. Support for this feature would greatly ease SDK distribution, lower app sizes, and improve package maintainability for iOS and all Swift platforms.
0
0
889
Sep ’25