Post

Replies

Boosts

Views

Activity

Reply to NSLog unreliable in Xcode 15 Console
Thanks to the helpful explanation in this article https://lapcatsoftware.com/articles/2023/10/5.html I understood the cryptic references in the XCode 15 release Notes and answered this myself. To return to XCode 14 and earlier world in which NSLog works you have to do this: Select the relevant product in the the Scheme dropdown (e.g. "[AppName] Watchkit App", or "[AppName]" for iOS app Select "Edit Scheme..." Select "Run" in list on the left Select "Arguments" tab Click ">" next to "Environment Variables" to show a (probably empty) list. Click "+" In "Name" column, double click the space and enter: IDELogRedirectionPolicy In "Value" column double click the space and enter: oslogToStdio Ensure the checkbox is selected Click Close button. You have to repeat these steps for each iOS, WatchOS product as each has its own Run Scheme. Now NSLogs will print to the Debug Console again. I have no idea about other side effects as I don't need more sophisticated logging. Works fine when connected by Network too.
Dec ’23
Reply to NSLog unreliable in Xcode 15 Console
I too am encountering this issue just since updating to XCode 15.0.1. I am using NSLog to report data from an actual Apple Watch device running in debug mode, coded in Objective-C. The watch is now connected directly as a standalone device (which is great and has solved the usual connection issues). But now no NSLogs appear ever, not from any process. Just a blank console. I only need NSLog to report variable values, track when functions are called while debugging my WatchOS app. After decades of "just using it", NSLog appears to have just switched-off! Any advice to see debug logging greatly appreciated. Right now I have to put in breakpoints and inspect which is very slow. Not sure if this is an XCode 15 issue, or the new way of connecting Apple Watch devices via network (which I like a LOT) Thanks
Dec ’23
Reply to URL from string with spaces in it
Swift String has a var .addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) amongst other options for allowedCharacters which can tidy-up strings used to creat URLs. The docs mention "Calling this method on strings that are already percent-encoded will cause percent characters in a percent-encoded sequence to be percent-encoded twice", but there is also a .removingPercentEncoding var to manage that
Topic: Programming Languages SubTopic: Swift Tags:
Aug ’23
Reply to App Group: File saving issue on physical device (works on simulator)
Hi I am experiencing the same issue with a QLPreview - writing works on Simulator does not on Device. Did you find a solutions? Thanks
Topic: Code Signing SubTopic: Entitlements Tags:
Replies
Boosts
Views
Activity
May ’24
Reply to NSLog unreliable in Xcode 15 Console
Thanks to the helpful explanation in this article https://lapcatsoftware.com/articles/2023/10/5.html I understood the cryptic references in the XCode 15 release Notes and answered this myself. To return to XCode 14 and earlier world in which NSLog works you have to do this: Select the relevant product in the the Scheme dropdown (e.g. "[AppName] Watchkit App", or "[AppName]" for iOS app Select "Edit Scheme..." Select "Run" in list on the left Select "Arguments" tab Click ">" next to "Environment Variables" to show a (probably empty) list. Click "+" In "Name" column, double click the space and enter: IDELogRedirectionPolicy In "Value" column double click the space and enter: oslogToStdio Ensure the checkbox is selected Click Close button. You have to repeat these steps for each iOS, WatchOS product as each has its own Run Scheme. Now NSLogs will print to the Debug Console again. I have no idea about other side effects as I don't need more sophisticated logging. Works fine when connected by Network too.
Replies
Boosts
Views
Activity
Dec ’23
Reply to NSLog unreliable in Xcode 15 Console
I too am encountering this issue just since updating to XCode 15.0.1. I am using NSLog to report data from an actual Apple Watch device running in debug mode, coded in Objective-C. The watch is now connected directly as a standalone device (which is great and has solved the usual connection issues). But now no NSLogs appear ever, not from any process. Just a blank console. I only need NSLog to report variable values, track when functions are called while debugging my WatchOS app. After decades of "just using it", NSLog appears to have just switched-off! Any advice to see debug logging greatly appreciated. Right now I have to put in breakpoints and inspect which is very slow. Not sure if this is an XCode 15 issue, or the new way of connecting Apple Watch devices via network (which I like a LOT) Thanks
Replies
Boosts
Views
Activity
Dec ’23
Reply to URL from string with spaces in it
Swift String has a var .addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) amongst other options for allowedCharacters which can tidy-up strings used to creat URLs. The docs mention "Calling this method on strings that are already percent-encoded will cause percent characters in a percent-encoded sequence to be percent-encoded twice", but there is also a .removingPercentEncoding var to manage that
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Aug ’23
Reply to Swiftui list row with multiple buttons?
simply add .buttonStyle(BorderlessButtonStyle()) to all the buttons in an HStack etc or on a list row and they will only fire individually and only when individually tapped.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jan ’23