Post

Replies

Boosts

Views

Activity

[UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPhone on iPad???
Hi, in an App I maintain we have a huge crash count at launch on the iPad. While I can't reproduce it, looking at the stack trace it seems [UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPhone evaluates to true under some conditions on iPadOS 15. (the crash occurs in an UIViewController that is allocated only on the iPhone in one code location) Is there anything that can cause [UIDevice currentDevice] to return nil, e.g. blocking the main thread? Thanks!
2
0
1.5k
Feb ’24
UIAlertController exception on presentation
Hi, One application I'm maintaining crashes on iOS16 beta 3 with an exception "Supported orientations has no common orientation with the application, and [UIAlertController shouldAutorotate] is returning YES". I'm running out of ideas how totrace down the reason. It only happens when the Main Thread checker is enabled it happens even if I display the alertcontroller totally early in applicationDidFinishLaunching a new setup sample with pretty much identical code (see below) until applicationDidFinishLaunching (and main.xib) does not throw the exception regardless of the Main Thread checker state I validated the build settings are identical between the sample and the crashing app #import "OCViewController.h" @interface OCAppDelegate: NSObject <UIApplicationDelegate> @property (nonatomic, readwrite, strong) IBOutlet UIWindow                  *window; @property (nonatomic, readwrite, strong) IBOutlet UINavigationController    *navigationController; @end int main(int argc, char * argv[]) {     @autoreleasepool {         return UIApplicationMain(argc, argv, nil, NSStringFromClass([OCAppDelegate class]));     } } @implementation OCAppDelegate - (void)applicationDidFinishLaunching:(UIApplication *)application {     OCViewController *vc = [OCViewController new];     self.window.rootViewController = vc;     [self.window makeKeyAndVisible];     [vc showAlert]; } @end @implementation OCViewController - (IBAction) showAlert {    UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"title" message:@"Test" preferredStyle:UIAlertControllerStyleAlert];    // NSLog( @"%@", [[[[UIApplication sharedApplication] keyWindow] rootViewController] valueForKey:@"_printHierarchy"] );    [alertController addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"OK", nil)                                                        style:UIAlertActionStyleDefault                                                      handler:^(UIAlertAction * _Nonnull action) {}                                ]     ];    [[[[UIApplication sharedApplication] keyWindow] rootViewController] presentViewController:alertController animated:YES completion:nil]; } @end The backtrace is +[NSException raise:format:] + 112 -[UIViewController __supportedInterfaceOrientations] + 808 -[UIViewController __withSupportedInterfaceOrientation:apply:] + 48 -[UIViewController setInterfaceOrientation:] + 108 -[UIViewController viewDidMoveToWindow:shouldAppearOrDisappear:] + 268 -[UIView(Internal) _didMoveFromWindow:toWindow:] + 1232 -[UIView(Hierarchy) _postMovedFromSuperview:]_block_invoke + 112 -[NSISEngine withBehaviors:performModifications:] + 84 -[UIView _postMovedFromSuperview:] + 672 -[UIView(Internal) _addSubview:positioned:relativeTo:] + 1904 -[_UIAlertControllerPresentationController presentationTransitionWillBegin] + 148 __80-[UIPresentationController _initViewHierarchyForPresentationSuperview:inWindow:]_block_invoke + 2008 [....]
2
0
1.9k
Aug ’22
[UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPhone on iPad???
Hi, in an App I maintain we have a huge crash count at launch on the iPad. While I can't reproduce it, looking at the stack trace it seems [UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPhone evaluates to true under some conditions on iPadOS 15. (the crash occurs in an UIViewController that is allocated only on the iPhone in one code location) Is there anything that can cause [UIDevice currentDevice] to return nil, e.g. blocking the main thread? Thanks!
Replies
2
Boosts
0
Views
1.5k
Activity
Feb ’24
UIAlertController exception on presentation
Hi, One application I'm maintaining crashes on iOS16 beta 3 with an exception "Supported orientations has no common orientation with the application, and [UIAlertController shouldAutorotate] is returning YES". I'm running out of ideas how totrace down the reason. It only happens when the Main Thread checker is enabled it happens even if I display the alertcontroller totally early in applicationDidFinishLaunching a new setup sample with pretty much identical code (see below) until applicationDidFinishLaunching (and main.xib) does not throw the exception regardless of the Main Thread checker state I validated the build settings are identical between the sample and the crashing app #import "OCViewController.h" @interface OCAppDelegate: NSObject <UIApplicationDelegate> @property (nonatomic, readwrite, strong) IBOutlet UIWindow                  *window; @property (nonatomic, readwrite, strong) IBOutlet UINavigationController    *navigationController; @end int main(int argc, char * argv[]) {     @autoreleasepool {         return UIApplicationMain(argc, argv, nil, NSStringFromClass([OCAppDelegate class]));     } } @implementation OCAppDelegate - (void)applicationDidFinishLaunching:(UIApplication *)application {     OCViewController *vc = [OCViewController new];     self.window.rootViewController = vc;     [self.window makeKeyAndVisible];     [vc showAlert]; } @end @implementation OCViewController - (IBAction) showAlert {    UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"title" message:@"Test" preferredStyle:UIAlertControllerStyleAlert];    // NSLog( @"%@", [[[[UIApplication sharedApplication] keyWindow] rootViewController] valueForKey:@"_printHierarchy"] );    [alertController addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"OK", nil)                                                        style:UIAlertActionStyleDefault                                                      handler:^(UIAlertAction * _Nonnull action) {}                                ]     ];    [[[[UIApplication sharedApplication] keyWindow] rootViewController] presentViewController:alertController animated:YES completion:nil]; } @end The backtrace is +[NSException raise:format:] + 112 -[UIViewController __supportedInterfaceOrientations] + 808 -[UIViewController __withSupportedInterfaceOrientation:apply:] + 48 -[UIViewController setInterfaceOrientation:] + 108 -[UIViewController viewDidMoveToWindow:shouldAppearOrDisappear:] + 268 -[UIView(Internal) _didMoveFromWindow:toWindow:] + 1232 -[UIView(Hierarchy) _postMovedFromSuperview:]_block_invoke + 112 -[NSISEngine withBehaviors:performModifications:] + 84 -[UIView _postMovedFromSuperview:] + 672 -[UIView(Internal) _addSubview:positioned:relativeTo:] + 1904 -[_UIAlertControllerPresentationController presentationTransitionWillBegin] + 148 __80-[UIPresentationController _initViewHierarchyForPresentationSuperview:inWindow:]_block_invoke + 2008 [....]
Replies
2
Boosts
0
Views
1.9k
Activity
Aug ’22
iOS15: SFSpeechRecognizer error kLSRErrorDomain code 201
Hi, I use device-local speech recognition for speech input. Now some iOS 15 upgraded devices return the new error domain / code kLSRErrorDomain, code 201 (previously the errors were mostly in kAFAssistantErrorDomain). Has anybody an idea what it means and how to fix it? Thanks!
Replies
2
Boosts
2
Views
2.5k
Activity
Oct ’21