Post

Replies

Boosts

Views

Activity

UIKitCore -[UIResponder doesNotRecognizeSelector:] crashes since IOS 15.7
Since iOS 15.7 these crash reports have started appearing: 0   CoreFoundation                0x18043bd1c __exceptionPreprocess + 216 (NSException.m:200) 1   libobjc.A.dylib               0x197c60ee4 objc_exception_throw + 56 (objc-exception.mm:565) 2   CoreFoundation                0x18050c75c -[NSObject(NSObject) doesNotRecognizeSelector:] + 140 (NSObject.m:147) 3   UIKitCore                     0x18359320c -[UIResponder doesNotRecognizeSelector:] + 268 (UIResponder.m:685) 4   CoreFoundation                0x1803d561c forwarding + 1472 (NSForwarding.m:3577) 5   CoreFoundation                0x1803d482c _CF_forwarding_prep_0 + 92 6   CoreFoundation                0x1803d22e8 CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER + 20 (CFNotificationCenter.c:652) 7   CoreFoundation                0x1804678e4 ___CFXRegistrationPost_block_invoke + 48 (CFNotificationCenter.c:173) 8   CoreFoundation                0x18043cc04 _CFXRegistrationPost + 416 (CFNotificationCenter.c:199) 9   CoreFoundation                0x1803e7070 _CFXNotificationPost + 708 (CFNotificationCenter.c:1147) 10  Foundation                    0x181ad704c -[NSNotificationCenter postNotificationName:object:userInfo:] + 92 (NSNotification.m:560) 11  UIKitCore                     0x182a9ac08 -[UIScene _invalidate] + 664 (UIScene.m:942) 12  UIKitCore                     0x182c2765c -[UIWindowScene _invalidate] + 160 (UIWindowScene.m:334) 13  UIKitCore                     0x182991f34 -[UIApplication workspace:willDestroyScene:withTransitionContext:completion:] + 216 (UIApplication.m:3999) 14  UIKitCore                     0x1829291a0 -[UIApplicationSceneClientAgent scene:willInvalidateWithEvent:completion:] + 360 (UIApplicationSceneClientAgent.m:61) 15  FrontBoardServices            0x1915b79d8 -[FBSScene _callOutQueue_agent_willDestroyWithTransitionContext:completion:] + 256 (FBSScene.m:456) 16  FrontBoardServices            0x1915bf810 __84-[FBSWorkspaceScenesClient _queue_invalidateScene:withTransitionContext:completion:]_block_invoke_2 + 100 (FBSWorkspaceScenesClient.m:622) 17  FrontBoardServices            0x1915a3bdc -[FBSWorkspace _calloutQueue_executeCalloutFromSource:withBlock:] + 232 (FBSWorkspace.m:352) 18  FrontBoardServices            0x1915b5470 __84-[FBSWorkspaceScenesClient _queue_invalidateScene:withTransitionContext:completion:]_block_invoke + 280 (FBSWorkspaceScenesClient.m:621) 19  libdispatch.dylib             0x1800fc094 _dispatch_client_callout + 16 (object.m:560) 20  libdispatch.dylib             0x18009f150 _dispatch_block_invoke_direct$VARIANT$mp + 220 (queue.c:501) 21  FrontBoardServices            0x1915a52ac FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK + 40 (FBSSerialQueue.m:157) 22  FrontBoardServices            0x1915a47c0 -[FBSSerialQueue _targetQueue_performNextIfPossible] + 176 (FBSSerialQueue.m:181) 23  FrontBoardServices            0x1915a8960 -[FBSSerialQueue _performNextFromRunLoopSource] + 24 (FBSSerialQueue.m:194) 24  CoreFoundation                0x18045c4fc CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 24 (CFRunLoop.c:1972) Looks like all system code. Anyone else running into these since iOS 15.7?
Topic: UI Frameworks SubTopic: UIKit Tags:
12
4
4.1k
Oct ’22
Unable to get CloudKit sync Notifications on Mac Catalyst Build -application:didFailToRegisterForRemoteNotificationsWithError: is being called
Working on a Mac Catalyst version of one of my apps. I noticed making changes on my iPhone (debug environment) aren't being pushed to my Mac (also in debug environment). Then when I quit and relaunch the app and manually force an iCloud sync at launch I get all the changes. At app launch I see the following method is being called on my AppDelegate after I attempt to register remote notifications: -application:didFailToRegisterForRemoteNotificationsWithError: with the error: Notifications are not allowed for this application" UserInfo={NSLocalizedDescription=Notifications are not allowed for this application}. Anyone experience this and have a solution? Under "Signing and Capabilities" I see an entry for Push Notifications for iOS and macOS.
1
0
947
Oct ’22
Mac Catalyst When to Handle Setting Min/Max Size for UISplitViewController columns? Window Resize Event?
Trying to use UISplitViewController. Since this app can be run on many different monitor sizes I want to allow the splits to be resized reasonably. There is this API: //Allow setting the primary column width with point values. This is especially useful in Catalyst where the window may be resized more often. // If set to non-Automatic, takes precedence over preferredPrimaryColumnWidthFraction. @property(nonatomic, assign) CGFloat preferredPrimaryColumnWidth API_AVAILABLE(ios(14.0)); // default: UISplitViewControllerAutomaticDimension > > @property(nonatomic, assign) CGFloat minimumSupplementaryColumnWidth API_AVAILABLE(ios(14.0)); @property(nonatomic, assign) CGFloat maximumSupplementaryColumnWidth API_AVAILABLE(ios(14.0)); // An animatable property that can be used to adjust the minimum absolute width of the primary view controller in the split view controller. @property(nonatomic, assign) CGFloat minimumPrimaryColumnWidth API_AVAILABLE(ios(8.0)); // default: UISplitViewControllerAutomaticDimension // An animatable property that can be used to adjust the maximum absolute width of the primary view controller in the split view controller. @property(nonatomic, assign) CGFloat maximumPrimaryColumnWidth API_AVAILABLE(ios(8.0)); // default: At what point in time should I be changing the preferredPrimaryColumnWidth, the min/and max width values? What event? If I was in Appkit I could maybe use something like NSWindowDidResizeNotification, then compute min/max sizes for each column based off the current window size (but I think NSSplitView gives the delegate an opportunity to control constraining column sizes if I remember correctly so I don't think that it would necessary to listen for a window resize event). I find the default sizes set by UISplitViewController to be insufficient (I want to allow users to size columns wider). Ideally this would be easier if there was minimumPrimaryColumnFraction and maxPrimaryColumnFraction. Then I just set the min/max fractions once to reasonable values and not worry about changing them on window resize. But since we can only set min/max with a hardcoded point size it seems more complicated?
0
1
524
Oct ’22
Window's title bar separator draws way out of place on Mac Catalyst, not even close to title bar location
So I built my app with Mac Catalyst. I see this little line appear and disappear periodically in the window. Then all of a sudden it disappears when the window's activation state changes sometimes. It looks like a weird little glitch. Turns out this is the title bar's separator which is UITitlebarSeparatorStyleAutomatic (I believe the system hides/shows the separator in this mode based on current window states. I change the separator style to shadow and sure enough it draws like a shadow and never disappears. It's not even close to where the separator is supposed to be (nowhere near the title bar). The only workaround I have is to use UITitlebarSeparatorStyleNone which I'll do if I have to but was wondering if someone else has run into this and has a better workaround.
5
2
1.1k
Oct ’22
if (@available(macCatalyst 15.0,*)) vs if (@available(iOS 15.0, *))
Experimenting with Mac Catalyst a bit. I see sometimes the compiler warns me about an API and suggests this fix:   if (@available(macCatalyst 15.0,*)) { /// Use API for this version of catalyst.... } And when I switch back to run on an iOS device the warning comes back and this time I get the suggestion: if (@available(iOS 15.0, *)) { //iOS 15 } If I just use the @available iOS 15 check and remove the macCatalyst check the compiler stops warning me when I try building on my Mac and on iOS, but the same isn't true the other way around (if I have code inside the macCatalyst version check, switching to build for an iOS device still warns me). I was expecting that code inside the if @available(macCatalyst 15,*) statement would only run on Mac catalyst if the version of macOS supports the API, but would not run on iOS at all (even if the API is available there too) but I still get compiler warnings on iOS and a suggestion for an extra if (@available(iOS 15.0, *)) which produces the following:  if (@available(macCatalyst 15.0,*))     {         if (@available(iOS 15.0, *))         { //do something iOS 15 and later...and macCatalyst 15 and later. } } What do I make of the macCatalyst availability check? It comes up in code completion but just using the iOS check seems like the correct way (it silences compiler warnings but I haven't tested on an older version of macOS to see if using any of this API would produce a crash). I conclude that if (@available(iOS 15.0, )) should be used pretty much always instead of if (@available(macCatalyst 15.0,)) and if I need code only for Mac Catalyst I should check the TARGET_OS_MACCATALYST macro instead:  #if TARGET_OS_MACCATALYST #else //iOS only #endif Is that correct?
1
0
1.3k
Oct ’22
Xcode Extensions in Xcode 14?
I noticed an Xcode Extension I wrote a couple of years ago isn't showing up in the Editor menu of Xcode. So I opened up the project, ran the Extension and the grayed out version of Xcode shows up but my extension no longer appears in the "Editor" menu. So I just tried to create a brand new Xcode project, with an Xcode extension. Right out of the box, no code changes from the template, and I can't get the new project's Xcode extension to appear in the "Editor menu". In System Preferences the app is checked off under "Xcode Extensions" but still nowhere to be found?
1
0
3.1k
Oct ’22
UIWindow safeAreaInset.bottom value is 20.0 on iPad even when window is presented like a "modal view controller" via UIWindowSceneActivationAction
When I open a new window via UIWindowSceneActivationAction, the window is shown like a modally presented view controller. I noticed a little layout hiccup when the window is in this state, because the window is reporting a safeAreaInset.bottom value of 20.0 even though the window is nowhere near the Home Indicator. Is there a good way to detect when a window is in this "modal like presentation" state on iPad? Size classes don't provide. I'd hate to have to sniff the frame of the window and compare it to the mainScreen frame (I know UIScreen.mainScreen is deprecated)?
Topic: UI Frameworks SubTopic: UIKit Tags:
1
0
425
Oct ’22
UITableViewHeaderFooterView Not Being Cleaned Up, Abandoned Duplicate Header (not sticky) sometimes appears in the table view
I'm having a hard time tracking the cause of this/ coming up with a workaround for this potential bug in UITableView. I have a UITableView, using the default section header view (I implement -tableView:titleForHeaderInSection: and return a string).After deleting some rows using -deleteRowsAtIndexPaths:withRowAnimation: I notice sometimes an extra header view will appear inside my UITableVIew. It has the same title as the sticky header above it, but it appears the table view lost its reference to the header view but didn't clean it up from the view hierarchy (it scrolls with the table view, never sticks to the top anymore). If I manually empty the entire data source and call reload data on the table view, the abandoned header view is still visible. Has anyone run into this before and know of possible cause and/or workaround?
Topic: UI Frameworks SubTopic: UIKit Tags:
7
0
4.9k
Sep ’22
iOS 16 UITableView: You are setting a new content configuration to a cell that has an existing content configuration, but the existing content view does not support the new configuration. Existing content configuration is nil.
I’m trying to migrate a custom UITableViewCell to use a content configuration so I can properly subclass the content view (setting a subclass on the content view in Interface Builder apparently is not supported). So when I load up the cell and set the content configuration my console is flooded with these logs: Warning: You are setting a new content configuration to a cell that has an existing content configuration, but the existing content view does not support the new configuration. This means the existing content view must be replaced with a new content view created from the new configuration, instead of updating the existing content view directly, which is expensive. Use separate reuse identifiers for different types of cells to avoid this. Make a symbolic breakpoint at UIContentConfigurationAlertForReplacedContentView to catch this in the debugger. Cell: <MyCellSubclassHere: 0x15d0b5c00> Existing content configuration: (null); New content configuration: <MyCustomConfigurationHere: 0x6000034ad190> As you can see the existing content configuration is nil. I tried setting my custom content configuration as early as possible (by overriding the designated initializer on UITableViewCell) as a workaround but that didn't work. Still console spew. And by the time cellForRowAtindexPath: is called the content configuration is always nil and has to be rebuilt (apparently UIKit is setting it to nil in prepareForReuse?) I also tried overriding -setContentConfiguration: to catch when the configuration is being set to nil but UIKit must be setting the ivar to nil directly, because the setter is never called with nil. Anyone know of a workaround? I don't want to ship an app that constantly logs this out on scroll. I opened FB11595949
Topic: UI Frameworks SubTopic: UIKit Tags:
3
0
1.6k
Sep ’22
iOS 16 -viewWillTransitionToSize:withTransitionCoordinator: bizarre value in the size parameter ((CGSize) size = (width = 414, height = 394)) on iPhone 14 Pro Max?
I noticed a bug on rotation change in my app on iPhone 14 Pro Max simulator. Basically a view in my view hierarchy is hidden when it shouldn't be. In landscape mode there isn't enough room for this view so I hide it on the iPhone (not essential). But when tilting back to portrait mode I unhide it. -(void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator {     [super viewWillTransitionToSize:size withTransitionCoordinator:coordinator];     BOOL isIPhone = UIDevice.currentDevice.userInterfaceIdiom == UIUserInterfaceIdiomPhone;    BOOL isIPhoneAndGoingLandscapeMode = (isIPhone                                           && size.width > size.height); if (isIPhoneAndGoingLandscapeMode) { self.someView.hidden = YES; } else { self.someView.hidden = NO; } } So this view controller is presented modally (form sheet style). On iPhone 14 Pro Max on orientation -viewWillTransitionToSize:withTransitionCoordinator: is called twice and the size parameter is always: (CGSize) size = (width = 414, height = 394) This is the sized passed to my app when rotating to portrait and landscape so my isIPhoneAndGoingLandscapeMode flag always is YES because 414 > 394. The 414 x 394 size appears to be false. My view controller's view in landscape on iPhone 14 pro max logs out to: (origin = (x = 0, y = 0), size = (width = 932, height = 430)) And 932 x 430 is the size I expected to be passed to me in -viewWillTransitionToSize:withTransitionCoordinator: Unless I'm missing something can this behavior be explained?
3
0
1.9k
Sep ’22
iPhone 14 Pro in Landscape Mode: UIView to UIImage using UIGraphicsBeginImageContextWithOptions generates clipped image. Image is Fine on iPhone 13 Pro Max
Testing on the iPhone 14 Pro simulator I notice if the device is in the landscape orientation, snapshot images my app takes are clipped (the x origin is off). I take a snapshot of a view like this: -(UIImage*)getSnapshotForView:(UIView*)snapShotView {  UIGraphicsBeginImageContextWithOptions(snapShotView.bounds.size, NO, 0.0f); [snapShotView drawViewHierarchyInRect:snapShotView.bounds afterScreenUpdates:YES]; UIImage *snapShotImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); return snapShotImage; } So I have an iPhone SE 3rd gen and all is working fine. But I figured I'd test in the iPhone 14 Pro simulator. When the simulator is in landscape mode the generated image is inset like 100 points on the x origin and the content is clipped off on the right side. So I looked at the view I was snapshotting and I thought I wasn't accounting for safe area insets properly (right and left) but I was. The subviews of the view I'm snapshotting all have the expected CGRect value for their frames. Looks like iPhone 14 Pro is rendering snapshots location on the x axis when the device is in landscape mode (at least that appears to be the case in the simulator at least). Any ideas if I'm doing something wrong?
2
0
1.4k
Sep ’22
presentedViewController Not set to nil on iOS 16 after dismissal. Calls to -presentViewController:animated:completion: then fail.
Testing my app, I noticed a button in my UI which presents a UIAlertController appeared to do nothing all of a sudden, after a few days. So hooking up the console app I see UIKit spit out the following log when I press the button: "Warning: Attempt to present UIAlertController on MyViewController which is already presenting SomeOtherViewController. No view controller appears to be presented. SomeOtherViewController is not currently in the UI but for some reason after it was dismissed the presentedViewController property wasn't set to nil (haven't been able to reproduce the issue yet). So SomeOtherViewController I know is a "Detail View Controller" which only get pushed on the UINavigationController stack (I never present it modally). The only time it gets presented modally is when it is a "preview view controller" used in UIContextMenuConfiguration, but otherwise it doesn't get presented. Has anyone run into this sort of situation before and know of a potential cause/solution? The presentedViewController does not appear on screen but for some reason UIKit is holding a strong reference to it in the presentedViewController property which prevents subsequent calls to -presentViewController:animated:completion: As a workaround I could try using the code below but I'd really like to find the root cause of the issue: -(void)presentViewController:(UIViewController *)viewControllerToPresent animated:(BOOL)flag completion:(void (^)(void))completion {     UIViewController *currentPresentedVC = self.presentedViewController;     if ([currentPresentedVC isKindOfClass:[SomeOtherViewController class]])     {        //this is unexpected.         [currentPresentedVC dismissViewControllerAnimated:NO completion:^{             [super presentViewController:viewControllerToPresent animated:flag completion:completion];         }];     }     else     {         [super presentViewController:viewControllerToPresent animated:flag completion:completion];     } }
Topic: UI Frameworks SubTopic: UIKit Tags:
0
0
1.4k
Sep ’22
Resize UITargetedPreview as part of custom animation?
I'd like to resize a UITargetedPreview as part of a custom animation. I tried doing this by using the animator provided in: - (void)tableView:(UITableView *)tableView willDisplayContextMenuWithConfiguration:(UIContextMenuConfiguration *)configuration animator:(nullable id<UIContextMenuInteractionCommitAnimating>)animator But resizing the source view for the target preview does not cause the container view to resize with it (leaving a large gap after my custom animation completes). So my preview is wrapped in a visual effects view that doesn't downsize with UITargetedPreview's view I provided. I also tried wrapping a snapshot view in a UIViewController and using previewProvider block instead of using a UITargetPreview. I am able to resize the previewViewController by setting the preferredContentSize property and resizing works, but it still doesn't look right because the default animation for the preview view controller breaks with the custom animation I'm trying to implement. Anyone know if this is possible?
Topic: UI Frameworks SubTopic: UIKit Tags:
0
0
391
Sep ’22
Missing or invalid signature. The bundle 'com.firebase.Firebase-nanopb' at bundle path is not signed using an Apple submission certificate
After upgrading to Xcode 14 I cannot submit an update to one of my apps that uses the GoogleMobileAdsSDK. I'm getting the following error when I try to submit to the App Store: Missing or invalid signature. The bundle 'com.firebase.Firebase-nanopb' at bundle path 'Payload/PATH_HERE/nanopb.framework' is not signed using an Apple submission certificate. Anyone else getting this and know of a solution?
1
0
1.1k
Sep ’22
Find & Replace: All properties on UITextSearchOptions are readonly? How am I supposed to use it with UIFindSession?
I'm trying to figure out how I'm suppose to work with this API on UIFindSession: - (void)performSearchWithQuery:(NSString *)query options:(nullable UITextSearchOptions *)options; I want to provide a UITextSearchOptions object, but the properties are readonly so I'm not sure what purpose it serves exposing it in the public API? @interface UITextSearchOptions : NSObject /// See UITextSearchMatchMethod above. @property (nonatomic, readonly) UITextSearchMatchMethod wordMatchMethod; /// Comparison options to use when searching for strings. @property (nonatomic, readonly) NSStringCompareOptions stringCompareOptions; @end So I can't simply invoke a search like this...which would've really been nice...        UIFindSession *session = findInterfaction.activeFindSession;    UITextSearchOptions *searchOptions = [[UITextSearchOptions alloc]init];  searchOptions.stringCompareOptions = NSCaseInsensitiveSearch; //readonly can't...   [session performSearchWithQuery:searchString options:searchOptions]; There is this API: /// available in @c UITextSearchOptions, which can be either modified, augmented, or omitted. @property (nonatomic, readwrite, copy, nullable) UIMenu *_Nullable (^optionsMenuProvider)(NSArray<UIMenuElement *> *defaultOptions); So I can remove menu items that edit the UITextSearchOptions but how exactly do I "override" them for my needs?
Topic: UI Frameworks SubTopic: UIKit Tags:
3
0
454
Sep ’22