Post

Replies

Boosts

Views

Activity

Reply to How can you print a WKWebView page on macOS?
A solution for macOS is discussed here that DOES work now (2021). It is the ONLY solution I know of that will print ALL on and offscreen content of a WKWebView. It currently is NOT working on iOS but I am working on that. See this stackoverflow post and the answer marked as correct: https://stackoverflow.com/questions/33319295/how-does-one-print-all-wkwebview-on-and-offscreen-content-osx-and-ios And here is the working code: https://gist.github.com/cribaudo/7e95c26c5d7e8ffe35741cbb3158fb62
Mar ’21
Reply to Code 173 no longer triggers receipt generation
This issue started for me today (5/13/22) IMMEDIATELY after Mac Software Update installed Xcode Command Line Tools 13.4. After that ANY MacOS App running in Xcode under does an Exit(173) due to NOT finding any App Store Receipts. I get this message: “x” is damaged and can’t be opened. Delete “x” and download it again from the App Store. I am not sure why it installed 13.4 before Xcode 13.4 is released but that is what update automatically installed. I'm on MacOS 12.3.1 (M1) and running Xcode 13.3.1. I tried rolling back to the 13.3.1 Command line tools but that didn't fix anything. Only way I can run and develop my mac apps now is to comment out the Receipt check. Bug report filed - FB10017618
May ’22
Reply to Crash Writing NSUserDefaults in CompletionBlock of dismissViewController
Thanks for the suggested code, but look at the code posted. It crashes (or that is how it looks while trying to write a value it just read from UserDefaults. Look at the code, it reads some counts stored in NSUserDefaults then does some math all in that method and then crashes while updating and attempting to write the updated counts all of which are in variables local to that method. It is only reading and writing values obtained from userDefaults?
Nov ’22
Reply to Crash Writing NSUserDefaults from applicationDidEnterBackground
I spent quite a while logging items, but here again, I have never actually seen this crash in Xcode or on any device or it would have been easier to find. I had a theory that perhaps the more controller or one of the tabs on it was not nilled out but could never prove it. The thing that is puzzling is that the documentation for applicationDidEnterBackground states that that is the place to do quick things like save state. And that is all this method is doing, it is saving the order of the users tabs and the last one selected so that it can remember it for next time. The symbolicated crash log indicates it crashes on the second to last line of saveAppData, the last call to setObject before the synchronize. Anyway darkPaw, thanks for your ideas. These are all good suggestions and they definitely got me thinking in probably the right direction. I don't know yet if they are the "RIGHT" answer but they are good suggestions.
Nov ’22
Reply to Crash Writing NSUserDefaults from applicationDidEnterBackground
But!! I did find this in the documentation for the tabBarController: In iOS 6 and later, if you assign a value to this view controller’s restorationIdentifier property, it preserves a reference to the view controller in the selected tab. At restore time, it uses the reference to select the tab with the same view controller. My code is older than iOS 6, to give you an idea how long that has been there :)- LOL and I missed the bit about state preservation. Probably I should just let it do it for me and not have my own code for that.
Nov ’22
Reply to Crash Writing NSUserDefaults in CompletionBlock of dismissViewController
***** THIS WAS THE REAL PROBLEM and SOLUTION ***** Moving stuff around helped me find a reliable way to produce the crash in Xcode and catch it in the debugger. Then I was able to consistently see way down in the crash report well after my code that each time it was mentioning an observer of NSUserDefaults. The class where all the above code was being used was registering itself as an observer of NSUserDefaults and also some Notifications. I was removing self as observer of NSNotifications but NOT NSUserDefaults. So after this class was released and attempted to persist values in NSUserDefaults that triggered a notification to it just as it was being release leading to -> CRASH!
Nov ’22
Reply to NSFetchedResultsController use-after-free issues in iOS 16.1
Yup! I am suddenly seeing a lot of crash reports (over 100 in the last couple of days) and ALL from users on iOS 16.1. This is new and nothing in that part of the App changed. Crashing right after the CoreData is initialized and NSPersistentCloudKitContainer is ready. At that point the controller does a fetchRequest for items in the Table and Crash with some kind of memory error. In my case it is simply making a request for items sorted alphabetically?!
Dec ’22
Reply to NSFetchedResultsController use-after-free issues in iOS 16.1
I filed a bug report on this with all the crash logs we are getting in Organizer (FB11875507). And then submitted a TSR for help with a work around. Apples response was that there is no work around and it is there issue. Seeing a lot less crash reports (but still some with the same issue) on iOS 16.2 and now also some from beta users on 16.3, but the numbers are way down and I have been telling customers to upgrade to latest iOS. It helps most.
Jan ’23