Post

Replies

Boosts

Views

Activity

Reply to Crash in app window resizing code
Thanks again, Claude. We are trying the third option you suggested, i.e. relocating the call in another func. Since ours is a macOS app, instead of viewDidLayoutSubviews we are using viewDidLayout method to call the configurePhotosCollectionViewAfterResize function. Also, TestFlight isn't for macOS apps, so we'll just have to try on a few different test machines. Will post an update later.
Topic: App & System Services SubTopic: Core OS Tags:
Apr ’21
Reply to Crash in app window resizing code
When some new users first reported the app crashing immediately on launch, we did comment out lines 7 to 52, and the crashes stopped. The main challenge is that we can't reproduce the crash on any of our test machines. So we can't check by uncommenting bit by bit. Somehow have to reproduce the crash or get clues from the crash report. Anything you can spot in the crash report that we might have missed? It's EXC_CRASH (SIGABRT), so unhandled language exception or application passing bad data to a system routine? It mentions (compiler-generated:0) i.e. crashing in compiled generated code at Line 0? You have already pointed out the crash reason pointing to infinite loop possibility.
Topic: App & System Services SubTopic: Core OS Tags:
Apr ’21
Reply to Crash in app window resizing code
Thanks, Claude. Below is the code for app window resizing: WindowDidResize Function (Note that the app has two panes, and on reducing the window width the left (L) pane is hidden - as in Photos for Mac app). func windowDidResize(_ notification: Notification) { if let window = self.view.window { let arrScreens = NSScreen.screens if arrScreens.count 0 { let theScreenRect = arrScreens[0] // Hide the L pane if (theScreenRect.frame.size.width / 3.0) = window.frame.size.width { window.setFrame(CGRect(x: window.frame.origin.x, y: window.frame.origin.y, width: (theScreenRect.frame.size.width / 3.0), height: window.frame.size.height), display: true, animate: true) theSplitView?.arrangedSubviews.first?.isHidden = true if (theSplitView.arrangedSubviews.count) 2 { theSplitView?.removeArrangedSubview((theSplitView?.arrangedSubviews.first)!) } else { theSplitView = orignalSplitView theSplitView?.arrangedSubviews.first?.setFrameSize(NSSize(width: 250.0, height: window.frame.size.height)) } } else { // Show the L pane window.setFrame(CGRect(x: window.frame.origin.x, y: window.frame.origin.y, width: window.frame.size.width, height: window.frame.size.height), display: true, animate: true) theSplitView = orignalSplitView theSplitView?.arrangedSubviews.first?.setFrameSize(NSSize(width: 250.0, height: window.frame.size.height)) theSplitView?.arrangedSubviews.first?.isHidden = false } // Don't allow to resize if (theScreenRect.frame.size.height / 1.5) = window.frame.size.height { window.setFrame(CGRect(x: window.frame.origin.x, y: window.frame.origin.y, width: window.frame.size.width, height: (theScreenRect.frame.size.height / 1.5)), display: true, animate: true) } else { // Allow to resize window.setFrame(CGRect(x: window.frame.origin.x, y: window.frame.origin.y, width: window.frame.size.width, height: window.frame.size.height), display: true, animate: true) } configurePhotosCollectionViewAfterResize() } Configure Photos Collection View func configurePhotosCollectionViewAfterResize() { self.collectionViewPhotos.collectionViewLayout?.invalidateLayout() } These are only two functions being called when the window is resized. If anything else is needed, please let me know. Maybe we need to add something after invalidating the layout? Not sure. Many thanks.
Topic: App & System Services SubTopic: Core OS Tags:
Apr ’21
Reply to “Account Not In This Store” error when trying to purchase non-consumable IAP within TestFlight
One tester is having this issue with the TestFlight version of our new app, it's working correctly for other testers. Using Sequoia on Mac M1.
Topic: App & System Services SubTopic: StoreKit Tags:
Replies
Boosts
Views
Activity
Dec ’24
Reply to iOS 14 added captions to Photos. Can we access them?
Those apps probably do it via SQL query, but if there is a way to do it via Photokit it would be great to know.
Replies
Boosts
Views
Activity
Aug ’21
Reply to Crash in app window resizing code
That seems to have fixed it! We still couldn't reproduce the crash, either before making the changes suggested by you or after, but have had no further complaints from users who were experiencing crashes. Thanks for your suggestions.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
May ’21
Reply to Crash in app window resizing code
Thanks again, Claude. We are trying the third option you suggested, i.e. relocating the call in another func. Since ours is a macOS app, instead of viewDidLayoutSubviews we are using viewDidLayout method to call the configurePhotosCollectionViewAfterResize function. Also, TestFlight isn't for macOS apps, so we'll just have to try on a few different test machines. Will post an update later.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Apr ’21
Reply to Crash in app window resizing code
When some new users first reported the app crashing immediately on launch, we did comment out lines 7 to 52, and the crashes stopped. The main challenge is that we can't reproduce the crash on any of our test machines. So we can't check by uncommenting bit by bit. Somehow have to reproduce the crash or get clues from the crash report. Anything you can spot in the crash report that we might have missed? It's EXC_CRASH (SIGABRT), so unhandled language exception or application passing bad data to a system routine? It mentions (compiler-generated:0) i.e. crashing in compiled generated code at Line 0? You have already pointed out the crash reason pointing to infinite loop possibility.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Apr ’21
Reply to Crash in app window resizing code
Thanks, Claude. Below is the code for app window resizing: WindowDidResize Function (Note that the app has two panes, and on reducing the window width the left (L) pane is hidden - as in Photos for Mac app). func windowDidResize(_ notification: Notification) { if let window = self.view.window { let arrScreens = NSScreen.screens if arrScreens.count 0 { let theScreenRect = arrScreens[0] // Hide the L pane if (theScreenRect.frame.size.width / 3.0) = window.frame.size.width { window.setFrame(CGRect(x: window.frame.origin.x, y: window.frame.origin.y, width: (theScreenRect.frame.size.width / 3.0), height: window.frame.size.height), display: true, animate: true) theSplitView?.arrangedSubviews.first?.isHidden = true if (theSplitView.arrangedSubviews.count) 2 { theSplitView?.removeArrangedSubview((theSplitView?.arrangedSubviews.first)!) } else { theSplitView = orignalSplitView theSplitView?.arrangedSubviews.first?.setFrameSize(NSSize(width: 250.0, height: window.frame.size.height)) } } else { // Show the L pane window.setFrame(CGRect(x: window.frame.origin.x, y: window.frame.origin.y, width: window.frame.size.width, height: window.frame.size.height), display: true, animate: true) theSplitView = orignalSplitView theSplitView?.arrangedSubviews.first?.setFrameSize(NSSize(width: 250.0, height: window.frame.size.height)) theSplitView?.arrangedSubviews.first?.isHidden = false } // Don't allow to resize if (theScreenRect.frame.size.height / 1.5) = window.frame.size.height { window.setFrame(CGRect(x: window.frame.origin.x, y: window.frame.origin.y, width: window.frame.size.width, height: (theScreenRect.frame.size.height / 1.5)), display: true, animate: true) } else { // Allow to resize window.setFrame(CGRect(x: window.frame.origin.x, y: window.frame.origin.y, width: window.frame.size.width, height: window.frame.size.height), display: true, animate: true) } configurePhotosCollectionViewAfterResize() } Configure Photos Collection View func configurePhotosCollectionViewAfterResize() { self.collectionViewPhotos.collectionViewLayout?.invalidateLayout() } These are only two functions being called when the window is resized. If anything else is needed, please let me know. Maybe we need to add something after invalidating the layout? Not sure. Many thanks.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Apr ’21