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
Aug ’23
Reply to Queried heart rate samples in the past interval have lower resolution than recent samples
I have noticed the same issue but cannot find documentation on this. I have previously exported Workout Data using RunGap and these files show the full resolution of the heart rate data, but the very same workouts on my iPhone older than 3 months now have only abbreviated heart rate data available when you do a query. At some point the iPhone appears to have cleared-out the HKSamples associated with workouts older than a certain time, and which were available in the past when I did those rungap exports which is very frustrating. If anyone knows how to restore these missing data I would be grateful to know how.
Jun ’21