Post

Replies

Boosts

Views

Activity

Comment on Completion handler blocks are not supported in background sessions
A slightly more complex code snippet works: let session = URLSession.shared let config = URLSessionConfiguration.background(withIdentifier: "SESSION_ID") config.sessionSendsLaunchEvents = true let backgroundSession = URLSession(configuration: config) let response = await withTaskCancellationHandler { try? await session.data(for: request) } onCancel: { let task = backgroundSession.downloadTask(with: request)) task.resume() }
Jul ’24
Comment on macOS 15.1b5, Xcode 16.1b2, does not compile
An Apple engineer resolved the issue for me in response to a FeedbackReport. Here was the problem, and a solution. Xcode 16 appears to have changed the header search behavior. My project was structured something like this: Project.xcworkspace Project.xcproject /Project \App <---- Folder containing all app source code /Development Sample Code <---- Folder containing ctype.h reference On Xcode 15.4, the headers in /Development Sample Code were not search, they appear to be in Xcode 16.
Oct ’24
Comment on Completion handler blocks are not supported in background sessions
A slightly more complex code snippet works: let session = URLSession.shared let config = URLSessionConfiguration.background(withIdentifier: "SESSION_ID") config.sessionSendsLaunchEvents = true let backgroundSession = URLSession(configuration: config) let response = await withTaskCancellationHandler { try? await session.data(for: request) } onCancel: { let task = backgroundSession.downloadTask(with: request)) task.resume() }
Replies
Boosts
Views
Activity
Jul ’24
Comment on macOS 15.1b5, Xcode 16.1b2, does not compile
An Apple engineer resolved the issue for me in response to a FeedbackReport. Here was the problem, and a solution. Xcode 16 appears to have changed the header search behavior. My project was structured something like this: Project.xcworkspace Project.xcproject /Project \App <---- Folder containing all app source code /Development Sample Code <---- Folder containing ctype.h reference On Xcode 15.4, the headers in /Development Sample Code were not search, they appear to be in Xcode 16.
Replies
Boosts
Views
Activity
Oct ’24
Comment on macOS 15.1b5, Xcode 16.1b2, does not compile
The resolution was to move the /Development Sample Code folder to a different location. And in general, you can search for files containing 'ctype.h' and remove them from the project folder.
Replies
Boosts
Views
Activity
Oct ’24