Post

Replies

Boosts

Views

Activity

Reply to WKWebView CSS does not update (MacOS, SwiftUI)
I've tried that, it doesn’t work. reload () as well as reloadFromOrigin () result in in blank pages. Probably because there is no URL (The data arrives using the API, then is stored as a String). Meanwhile, I have dug a bit into it using Instruments. While the first apparition of the WebView takes around 11.2 ms, the update triggered by the JS injection lasts only 3.3 ms. So clearly, the HTML page is not parsed again the second time. Apparently the code calls a method of a WebKit::WebPageProxy object, so I wonder if some form of caching doesn’t interfere at this point, though later (and right before the update finishes), the code calls CSSStore2::String::Find. But at no point do I see any hint of JS script execution. As a further note, it just occurred to me that my custom WebView does not appear in Instruments under the SwiftUI list of managed views. Would that mean it receives a different treatment than standard views? In any case, I think it is high time Apple added a built-in web browser to the collection of SwiftUI gadgets.
Mar ’23
Reply to Deselecting SwiftUI table rows ends up only deselecting visible rows??
Well, this is getting worse by the day. Now it crashes with errors like [General] NSTableView error inserting/removing/moving row 64 (numberOfRows: 2). The contents of the table change dynamically according to filters (like, say, a search regex pattern). I wonder if that’s what causes the problem. I tried to synchronise every change in contents to the main thread to not interfere with view updates, but to no avail. I also have those purple messages about publishing updates within view updates, but the stack doesn’t show any of my user code, as if it was inside the underlying Cocoa library itself.
Sep ’22
Reply to Deselecting SwiftUI table rows ends up only deselecting visible rows??
To be honest, I have a lot of other problems with this Table, like I keep getting messages such as ‘WARNING: Application performed a reentrant operation in its NSTableView delegate. This warning will become an assert in the future’ and even crashes such as ‘[General] NSTableView error inserting/removing/moving row 18 (numberOfRows: 1).’ SwiftUI Table doesn’t seem to play well with dynamically changing contents…
Sep ’22
Reply to Recursive NavigationStack? → stuck at level 2?
Thanks a bunch! I ended up adopting an entirely different tactics (I wrote an OutlineGroup-like widget where I have individual control over the state of the different DisclosureGroups – to be more precise, there isn't even a single DisclosureGroup involved in it, but it looks like if). However, I’ll be storing your code for future use! Once again, thanks so much for answering!
Sep ’22
Reply to Swift UI ‘ghost’ outline left over during TextField edition
Yeah, you’re right, I am aware of that, and I’m taking great pains to stay safe. But what I am at a loss is where a data race could occur so early in the code. My @stateobject is marked @MainActor, but there is no background thread activity before the OK button is clicked (credentials check). Thus the only write operations that occur on the state object at this stage are the updates triggered by the TextFields themselves. There’s a if statement in the WindowsGroup in order to move on to a different window if the credentials are cleared, but the glitch happens even if I remove the if part. Really, I’m a bit stumped. UPDATE: This seems related to the use of SecureField. When I use a TextField instead, the outline doesn’t seem to show up. I wonder if this is not caused by an interference with the password pop-up that shows up and offers to pick up a username/password combination already registered (maybe the system wants to show it, but then reneges on that).
Aug ’22
Reply to Big Sur Mac Crash 4 times in the last 6 hours - 2 no-report and 2 reports
I'd like to pile on :) Since I have upgraded to 11.5 beta (20G5042c) my MacBook Air has become so unstable it’s impossible to compile anything on it. Clang will crash, and then the system will panic at the earliest opportunity. I can’t even install MacOS 12 on it, the installer breaks at the very end. I’m pretty sure something is broken with the memory allocator, judging by what forensics I get (malloc/free inconsistencies, as others have mentioned). I assume the VM swapping mechanism is buggy. That would explain why the panics only happen when the memory gets almost full and the swapping mechanism kicks in. Anyways. I agree that as time passes on, MacOS gets pointlessly more complex, making it more prone to bugs. It’s high time Apple focussed on the kernel design rather than touting cosmetics features so few people care about.
Jun ’21