Thanks for the reply.
I just wanted to examine the certificates and authorities on my computer, as I work around the much-discussed "certificates not available to trust" bug on iOS 18.
In a "Made for my Mac (iPad)" build, I wasn't able to connect to localhost using HTTPS. So I was trying to figure out why.
Post
Replies
Boosts
Views
Activity
It’s better if you reply as a reply, rather than in the comments
I appreciate that guideline; I've seen you make that remark to other people, so I thought this meant reply directly to your comment instead of making a new comment. So I went from doing it "right" to doing it "wrong."
Thanks guys. But I'm not using AVPlayerView! That string doesn't even occur in my source, or in DerivedData.
I can't post my entire project. I'll see if I can reproduce it with a basic test one.
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?"
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
Same. The documentation doesn't say what to import, if anything.
Nor does it say what the difference is between any of the MPMusicPlayer stuff and SystemMusicPlayer and ApplicationMusicPlayer. It's a mess.
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]}
ZStack
{
RoundedRectangle(cornerRadius: 10 )
.frame(width: 70, height: 70)
.foregroundStyle(item.color.gradient)
Image(systemName: item.image)
}
Have you tried that?
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.
I'm working with MusicKit right now, and found that while API calls fail in an iOS 15 simulator, they work in an iOS 16 one. Search queries do, at least.
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.
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"
}
}
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.
it seems like SwiftUI internally could ask to receive the published updates on the main queue and @Published shouldn't enforce a specific thread.
I asked why publishing isn't done on the main thread automatically. The discussion is here for anyone interested.
Never mind the last question; further research shows that it does not necessarily execute on the main thread.