Post

Replies

Boosts

Views

Activity

Reply to NWPathMonitor.pathUpdateHandler behavior
Part of the code: let queue = DispatchQueue(label: "NetworkManager") ssPathMonitor.start(queue: queue) ssPathMonitor.pathUpdateHandler = { path in DispatchQueue.main.async { let internetWifiAvailableOld = self.internetWifiAvailable let internetCellularAvailableOld = self.internetCellularAvailable let internetEthernetAvailableOld = self.internetEthernetAvailable self.internetWifiAvailable = path.usesInterfaceType(.wifi) self.internetCellularAvailable = path.usesInterfaceType(.cellular) self.internetEthernetAvailable = path.usesInterfaceType(.wiredEthernet) // Log("NetworkManager satisfied:", path.status == .satisfied ? "YES" : "no" , "WIFI:", self.internetWifiAvailable, "CELL:", self.internetCellularAvailable, "ETHERNET:", self.internetEthernetAvailable) let internetWifiChanged = internetWifiAvailableOld != self.internetWifiAvailable let internetCellularChanged = internetCellularAvailableOld != self.internetCellularAvailable let internetEthernetChanged = internetEthernetAvailableOld != self.internetEthernetAvailable In the past I had used Reachability, but no sane person can make sense of the code later on (even the author!). This PathMonitor seemed like a godsend! What I expected to see was changes to multiple interfaces going on: cell -> satisfied: block gets called wifi -> satisfied: block gets called cell -> unsatisfied: block gets called etc. But that doesn't happen - I get notified when a path is available, so in the 3 events above I get the first two, but not the 3rd - I don't get "unsatisfied" if there is a path. I recall that if both are unavailable (AirPlane mode), at least the last "satisfied". Perhaps I should have multiple monitors going - one for each of cell, wifi, and wired. Even then I'm skeptical of whether I'll get told when one goes down, but maybe that is unwarranted. I know of all the arguments against doing this, and we should just kick off the network no matter. The reality is that the designers of the app I use have you go down a deep hole to do something if it's up, and if network is unreachable it doesn't even try. Just ignoring status at the moment would wreck havoc with the user base. Because we allow massive data to flow in either direction, we also condition on cellular - but I believe most users don't disable cellular data, so its not been an issue (in the past they might have). My recollection is that I could maintain separate states for cell, wifi, and wired using Reachability. If I have three NSPathMonitors for each, will I then get a real status for each? Thanks!!!
2w
Reply to Core Data migration then run old app version
Update: I've been running the app in Xcode for quite some time now, switching between newer and older versions of the code, and Core Data seems perfectly happy in accepting a "newer" repository and "downgrading" it to an older revision. I have never seen anything on this topic, but I guess the geniuses that developed Core Data anticipated this case! It sure has made my life easier!
Nov ’24
Reply to Did autorelease pools become no-ops? Look at this memory usage graph!
Quinn, Well that was sort of ******-in-cheek! I didn't really think they had gone away, but perhaps behavior had changed. Our issue is just so bizarre. In he end I pulled out an old Mac running Montery, loaded Xcode 14.2, and build the much older version of the app for which there had been no memory complaints. When I build the above app, I got the same result! So something in our backend objects increased the size - who knows what at the moment. What confounded the issue is we had one complaint with the new app, then we started getting an avalanche of them - and we had (to our knowledge) not changed anything! Murphy at it again! David
Feb ’24
Reply to Does UIGraphicsEndPDFContext flush and close the context file?
In the end I wrote some code that grabbed the last file modification date just before the end context, then immediately after, and once very 0.1 seconds for a minute. It never changed from the second read (immediately after the EndPDFContext). I ran a slew of tests using different files being created, some tens of megabytes. Thus I infer that the file is not modified after UIGraphicsEndPDFContext.
Jan ’24
Reply to App is at 1% deployment, gets updated, what happens then?
Well, I didn't state ir correctly. I ask Apple to approve 1.1.1 and they do. I then click "Release with slow rollout". Then, before they do that, they push 1.1.0 to every device that isn't on it, only then start rolling out 1.1.1. However, now I typed it all out - it does seem impossible. I guess I need to cut back on my drug use... That said, so the moment 1.1.1 is released, I have lots of users on 1.0.0 and a few on 1.1.0. All users candidates for 1.1.1 slow rollout?
Oct ’23
Reply to Bonjour stopped responding in iOS15
So in the end it turned out that "Local Network" in Settings was off. But everything else the app does on the local network was operational (HTTP, etc). We were experimenting a while ago with techniques to try and detect if that setting was on or off (it does not appear there is any straightforward way to make that determination), and I must have left the toggle off. Sigh. But Quinn, thanks for the link above - it was very enlightening (even though we seem to have had everything defined properly).
Oct ’21