Post

Replies

Boosts

Views

Activity

Reply to Private CA root certificate missing from trust settings
I just encountered this in iOS 18.0.1. I generated a CA and certs using mkcert, and I've been able to trust these on iOS in the past. Not on my new phone with 18.0.1. I can install the root CA on the phone (after AirDropping) without any apparent problem, but it's missing from Trust Settings. Since these worked on iPhones in the past, presumably it's not the "common name" bug. But how do we know if the CA has a "common name?"
Oct ’24
Reply to log noise? : "NSPersistentUIDeleteItemAtFileURL blablabla"
I'm also having what may be a related problem: When building for "My Mac (designed for iPad)," Xcode does not overwrite previous builds. So you'll make a bunch of code changes and then re-run your app, only to see that your changes "didn't work." But that's because Xcode is still running the old code, wasting hours of your time. Right now you have to add a "clean build directory" step to every project if you want to run on Mac. I'm getting a bunch of error messages in the Xcode console, such as the one you mention here, along with: AX Safe category class 'SFUnifiedBarRegistrationAccessibility' was not found! CLIENT ERROR: TUINSRemoteViewController does not override -viewServiceDidTerminateWithError: and thus cannot react to catastrophic errors beyond logging them
May ’24
Reply to MPMusicPlayerController prepareToPlay errors
Playing music with SystemMusicPlayer NEVER works on my M1. The code that works on my phone produces this on the Mac: systemMusicPlayer _establishConnectionIfNeeded failed [application failed to launch] Failed to prepareToPlay with error: Error Domain=MPMusicPlayerControllerErrorDomain Code=10 "Failed to obtain remoteObject [nil server]" UserInfo={NSDebugDescription=Failed to obtain remoteObject [nil server]}
Mar ’24
Reply to Why is AVAudioRecorder creating corrupt files?
Well, since there's inexplicably no way to delete or even edit this post, I'll follow up by saying that I found the problem. Some of my code was inadvertently reverted, and my app was creating a play-only (as opposed to record/play) audio session. This of course raises the question as to why I was allowed to create an AVAudioRecorder under an inapplicable session, when the attempt is already a "try" operation and could have thrown an informative error right there. And why was there no error message at any stage of this, saying "trying to record in a playback-only session?" Pretty lame.
Mar ’24
Reply to Presenting alert in SwiftUI at the right time
It may be failing because the parent view's contents aren't embedded in a NavigationView. If you put the entire contents inside a NavigationView it'll probably work. I just encountered this when trying to raise a sheet from a sheet that didn't have a NavigationView. Interestingly, it failed on iOS 15 but not later.
Mar ’24
Reply to Having Trouble passing a ButtonStyle as a parameter to a func
I'm trying to create a custom button where I can pass in a style. I have figured out how to pass a ButtonStyle as a parameter using a generic, but after that I can't do anything with it: struct SelectableButton: View { @Environment(\.isEnabled) private var isEnabled var text: String = "" var icon: Image? var onClick: (() -> Void) var selected: Bool = false var style: Any init<S: ButtonStyle>(label: String, icon: Image? = nil, onClick: @escaping (() -> Void), style: S) { text = label self.icon = icon self.onClick = onClick self.style = style } var body: some View { Button(action: onClick) { HStack { Text(text) icon } } .buttonStyle(self.style as! ButtonStyle) // DOES NOT WORK. "No exact matches" } }
Jan ’24
Reply to Why aren't changes to @Published variables automatically published on the main thread?
As my work continues, I found that the MainActor solution is not a panacea because you can't make a Codable/Decodable class a MainActor. Often you need your data-model classes to conform to those protocols, and those classes are often full of published members to support display in SwiftUI. So it's back to hunting down all possible manipulations of them and enclosing them in a main-thread dispatch.
Jan ’24