Post

Replies

Boosts

Views

Activity

init(from decoder: Decoder) not running when decoding an array of classes
Let's say we have 2 decodable structs in Swift 5.5, and one of them has a property that contains an array of one of the structs: struct MySecondDecodable: Decodable { public let mySecondProperty: String private enum CodingKeys: String, CodingKey { case mySecondProperty } init(from decoder: Decoder) { let values = try decoder.container(keyedBy: CodingKeys.self) mySecondProperty = try values.decode(String.self, forKey: .mySecondProperty) } } struct MyDecodable: Decodable { public let myProperty: [MySecondDecodable] private enum CodingKeys: String, CodingKey { case myProperty } init(from decoder: Decoder) throws { let values = try decoder.container(keyedBy: CodingKeys.self) myProperty = try values.decode([MySecondDecodable].self, forKey: .myProperty) } } I cannot breakpoint on MySecondDecodable's init function. In fact, I cannot even see it's running. Why is this happening? Why can't I breakpoint the initialization of every single MySecondDecodable in the array? Is there a way to do such a thing?
4
0
2.5k
Feb ’22
QLPreviewController title is misaligned with the rest of the UI components on Mac Catalyst
For some reason, when I open a QLPreviewController on macOS Big Sur (using Mac Catalyst), the preview item title label is misaligned with the rest of the top bar components in the Quick Look window that was opened. Please refer to the link below for an image showing the issue (remove the spaces, this is in order to avoid the Apple Developer Forum system to filter my question). Side note: this issue doesn't ever surface on iOS. Link to image (remove all spaces): h t t p s : / / p o s t i m g . c c / Z C W x 6 L 1 X Thank you! This issue is not extremely urgent but I must say that it's pretty irritating 😅
1
0
756
Mar ’21
Apple Hypervisor is completely broken on MacOS Big Sur beta 9
I am trying to make a basic command-line tool that makes a VM and runs something using Apple Hypervisor. When I try to run: hv_vm_create(HV_VM_DEFAULT); it gives me an error code -85377023. I tried enforcing App Sandbox and setting the entitlement accordingly for the Big Sur compile target, and now I am getting this output in the console: Killed From what I understand from this, this is AMFI killing my process. Is this a bug or my problem? When I decided to go down the rabbit hole, I found that in the MacOS Big Sur 11.0.1 beta release notes, they deprecated hv_vm_run(_:), while the API documentation says that this function is in beta. I didn't go as far as disabling AMFI with a kernel flag, but I am almost certain that this is not expected behavior. And that, no matter what, hv_vm_run(_:) can never be deprecated OR be in beta. I am sure that this function existed well before Big Sur. If anyone can help me with this or just give a response, please do. Do not keep me in darkness as I don't want to waste time on something which is potentially broken. Thank you.
2
0
1.1k
Nov ’20