iOS Simulator Quits: reason: '-[UIKeyboardTaskQueue waitUntilAllTasksAreFinished] - ios

as the title indicates, I have an app in development in Xcode, using the iPhone simulator to test. I've started getting this :
uncaught exception 'NSInternalInconsistencyException', reason: '-[UIKeyboardTaskQueue waitUntilAllTasksAreFinished]
Previously, I had the IQKeyboard cocoa pod handling the layout, so fields would be accessible in landscape format, but a change of layout eliminated the need for that, and it was removed, along with all calls to it. I doubt this is the answer, but I'm mentioning it in case.
I am using a physical keyboard during testing. This problem has not previously cropped up in weeks of development.

Related

Xcode error on running app with embedded framework

I am trying to create framework of my existing app which can be added to any other app as a module. In previous version of the app, i don't have any issues creating the framework and adding it to a demo app to test if it works. With newer version of the app, i am having an issue:
2017-04-21 13:59:02.238333-0400 XXX[8320:3762763] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '* -[__NSArrayM insertObject:atIndex:]: object cannot be nil'
*** First throw call stack:
(0x1868c2fd8 0x185324538 0x1867a4888 0x1010c3948 0x18c9f1f9c 0x18ca09a28 0x18cb8e2a0 0x18caa8c4c 0x18caa88b4 0x18caa8818 0x18c9ef158 0x189bdf274 0x189bd3de8 0x189bd3ca8 0x189b4f360 0x189b763c0 0x189b76e8c 0x1868709a0 0x18686e628 0x18686ea74 0x18679ed94 0x188208074 0x18ca57130 0x100084860 0x1857ad59c)
libc++abi.dylib: terminating with uncaught exception of type NSException
Any suggestions how to trace back the error inside the embedded framework?
It is happening only with the main View Controllers of the app, not on any off the second level View Controllers which are accessed from these main View Controllers.
I went through the code of the old version and the new version of the embedded framework, i don't see anything major to be different, checked Line by Line the whole code.
Any suggestions?
Thank you codealchimist for the solution, i figure out what i was missing in order to be able to debug it. The solution provided by him solves the problem to be able to debug the app & framework.

Unrecognized selector UIDeviceRGBColor countByEnumeratingWithState:objects:count:

I know this is kind of a dupe, but I don't have enough reputation yet to comment on the original post and, while I don't have an answer, I do have more useful information (a concrete example). Moderators, feel free to move this to the proper location.
When compiling my code using the latest XCode 8 beta 6 (iOS 10 SDK), I get an exception "Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIDeviceRGBColor countByEnumeratingWithState:objects:count:]: unrecognized selector sent to instance 0x600000071340'"
This happens during the call:
auto viewController = [[[UIViewController alloc] initWithNibName:#"ViewController" bundle:nil] autorelease];
I have isolated the problem by whittling down my project to the bare minimum that will compile and still exhibit the problem. You can download it here:
Example project
Note that I took out lots of code, nearly all classes are gone, which results in a lot of warnings (not errors) for nonexistent classes referenced from the xib. But that doesn't matter, the code still compiles and runs just fine with the iOS 9 SDK. After compiling with the iOS 10 sdk, however, it crashes both in the simulator and on devices running iOS 9.
You can work around the problem by changing "#if 0" into "#if 1" in the file "HackForUnrecognizedSelectorInIOS10.m". This adds a category defining the missing selectors for UIColor. But obviously you can't add that to shipping code, it's just a temporary stopgap measure to continue developing.
I filed a bug report (28153870). But if anyone has any more information on how to avoid this problem without ugly hacks, any information is welcome.
Thanks
Michel Colman
When I try to compile and run my project with the same configuration (XCode 8 beta 6, iOS 10 SDK), I encountered a similar issue, except that my error message was:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIDeviceRGBColor length]: unrecognized selector sent to instance 0x600000479280'
And I noticed that this issue only occurs when the view is init by using interface files, i.e. Xib and Nib. I solved this issue by:
Open your interface file, in the right panel, navigate to the File Inspector tab.
Change the attribute highlighted to "iOS 7.0 and Later" (or whatever iOS version later)
Then compile and run your project again, this should fix your issue, though I am not sure about the reason behind this. I tried the same with your sample project and it solves the issue too.
In my case, I needed to change the project deployment target to 8.0 in the product general settings. Thanks to the hint from the accepted answer!

iOS 10 Beta SDK - [UIDeviceRGBColor countByEnumeratingWithState:objects:count:]: unrecognized selector

When our iOS application is compiled on iOS 10 Developer Preview SDK, when launching one of the first view controllers of the application, the application crashes with this exception :
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIDeviceRGBColor countByEnumeratingWithState:objects:count:]: unrecognized selector sent to instance 0x17adb5a0'
*** First throw call stack:
(0x23c9b91b 0x23436e17 0x24474da3 0x24474f5f 0x24447e81 0x24446f25 0x286c8a0b 0x2857baa3 0x2834effb 0x28214a1f 0x28214971 0x28aa9ec1 0x28560d01 0x285846e5 0x28586d65 0x28223541 0x28586ca9 0x28586f91 0x2830ddb9 0x28586fcf 0x1c13b3 0x1beb89 0x1bf927 0x244c6655 0x23c5e58f 0x23c5e1c1 0x23c5c00d 0x23bab229 0x23bab015 0x2519bac9 0x2827d189 0xe3b65 0x23853873)
libc++abi.dylib: terminating with uncaught exception of type NSException
In the code of our application, this selector of UIDeviceRGBColor is never called.
Does someone have the same problem ? Is it a bug of iOS 10 Beta ?
When compiled with iOS 10 Beta SDK, the problem occurs as well on devices running on iOS 10 Beta as on iOS 9.
The problem does not appear (not on iOS 10, not on iOS 9) when the application is compiled with iOS 9 SDK
Thank you.
Best regards.
In case your are using interface files like Xib and Nib for your views, refer to my answer in this question
Quoted from that question:
When I try to compile and run my project with the same configuration (XCode 8 beta 6, iOS 10 SDK), I encountered a similar issue, except that my error message was:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIDeviceRGBColor length]: unrecognized selector sent to instance 0x600000479280'
And I noticed that this issue only occurs when the view is init by using interface files, i.e. Xib and Nib. I solved this issue by:
Open your interface file, in the right panel, navigate to the File Inspector tab.
Change the attribute highlighted to "iOS 7.0 and Later" (or whatever iOS version later)
Then compile and run your project again, this should fix your issue, though I am not sure about the reason behind this.

NSInvalidUnarchiveOperationException (NSLayoutConstraint) iOS5

I'm getting a NSInvalidUnarchiveOperationException on the iPhone 5.1 Simulator.
*** Terminating app due to uncaught exception 'NSInvalidUnarchiveOperationException',
reason: 'Could not instantiate class named NSLayoutConstraint'
Everything works fine on iOS6 and on the iPad 5.1 Simulator.
The thing is I'm not using NSLayoutConstraints in my Project nor does it contain any Nib-Files!
Any sugestions?
Thanks in advance!
I don't know what it was, but uninstalling and reinstalling the app did the trick (a "clean" didn't by the way).

iPad app closes after 2 seconds, memory issue?

I made a magazine iPad app so you can scroll through different slides to the left, right, down and up. It's all ready and accepted by the iTunes app store. Problem is, if someone downloads the app it closes directly after 1 seconds of loading.
Weird part is that i installed the app trough xCode and all works without any problems. My guess is that the app takes too much memory. I made a screenshot of the memory instrument:
But how can i release a Srollview if it must be loaded all the time?
Hope someone could push me in the right direction!
I have tested your app on my iPad2 with iOS 5.1.1, and it crash with the following message:
OxygenEvents[97151] <Error>: *** Terminating app due to uncaught exception 'NSInvalidUnarchiveOperationException', reason: 'Could not instantiate class named NSLayoutConstraint'
*** First throw call stack:
(0x375c388f 0x31638259 0x375c3789 0x375c37ab 0x309de54d 0x309de6bb 0x309de423 0x3096f001 0x308dd3c7 0x307bac59 0x30730c17 0x10d5d5 0x30730c8b 0x109beb 0x30730c8b 0x3072f461 0x30721e87 0x307927d5 0x10960b 0x3072fcab 0x307297dd 0x306f7ac3 0x306f7567 0x306f6f3b 0x3771322b 0x37597523 0x375974c5 0x37596313 0x375194a5 0x3751936d 0x3072886b 0x30725cd5 0x10944f 0xf0050)
It is because you use "Autolayout" in your Interface Builder files (nib / xib files), which is an iOS 6.0 only feature.
To solve this, either disable Autolayout in all your xib files like this:
or simply make your app iOS 6.0 only by setting deployment target as iOS 6.0

Resources