I am using UISearchController and I am getting this error after I try to reload data after filtering the content array. This doesn't happen if I set any other view than the tableView's tableHeaderView to be the searchBar of UISearchController. If I use any other view to hold the searchbar everything works fine. Has anyone had this error, if so what was the solution.
Assertion failure in -[UITableView _cellReuseMapForType:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit_Sim/UIKit-3512.29.300.16/UITableView.m:3962
2015-11-15 15:43:34.166 AirMediaCenterTV[23894:1052893] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'attempt to access view reuse map for unknown view type 4'
I've seen a similar crash issue on tvOS but I can't seem to figure out a fix. I'm not using a UISearchController. I've removed all the registerClass: calls from the UITableView and that didn't seem to work.
Related
I want to use an UISearchDisplayController on UIViewController, that includes an UITableView.
I use Autolayout. When i try to put the SearchBar (_searchBar) in the tableHeaderView with
self.tableView.tableHeaderView = _searchBar;
I get the error
'NSInternalInconsistencyException', reason: 'Auto Layout still required after executing -layoutSubviews. UITableView's implementation of -layoutSubviews needs to call super.'
Disabling Autolayout, the error disappears, but i need Autolayout...
The error appears, when I use Custom Cells or StandardCells...
The error appears, when the TableView has no rows...
As a general solution to this problem, or at least a way of finding the cause of it:
Turn on exception breakpoints
Subclass UITableView and override layoutSublayersOfLayer:, just calling super
Run your app - you will stop in your new method
In the debugger, type po [self _autolayoutTrace]
This will show you a printout of every view in the window, with the views where auto layout has not been able to come up with a solution highlighted by asterisks or AMBIGUOUS LAYOUT. These are the views you need to investigate the constraints for.
When adding a subview to UITableView there are some specific requirements for the subview. Consider adding the subview to another view(superview) in your controller instead of UITableView.
"Auto Layout still required after executing -layoutSubviews" with UITableViewCell subclass
This question already has answers here:
Xcode - How to fix 'NSUnknownKeyException', reason: … this class is not key value coding-compliant for the key X" error?
(79 answers)
Closed 7 years ago.
Hi I seem to have stumbled upon weird thing while developing a storyboard app.
My app is halted right after splash screen and in console I get error message:
Missing proxy for identifier UIStoryboardPlaceholder
Now, if I try to let the app continue running, I get new messages into console, which I believe are related to the fact, that there is something wrong with the first error message
*** Terminating app due to uncaught exception 'NSUnknownKeyException', reason:
'[<IntroViewController 0x6e35f40> setValue:forUndefinedKey:]:
this class is not key value coding-compliant for the key sceneViewController.
What is strange I get this error only when working with iOs 5.1 Simulator. It works fine on iOs 6 simulator and also on devices with both iOs 6 and iOs 5.1
I tried to find answer, but google says it could not find any results for the word UIStoryboardPlaceholder, let alone the whole error message. I made sure, I don't have the word 'UIStoryboardPlaceholder' anywhere within my xcode project(not even inside nib files) and also there's nowhere mentioned 'sceneViewController'. Any idea what might be wrong?
EDIT: I tried to reset simulator and cleaning project, but to no avail
We had the same problem: a view controller in a storyboard file with its interface defined in a separate XIB file. (Using Xcode 6.3.1, iOS 8.3 and Swift 1.2.)
We are using Swift so we had added the #objc() declaration to the class declaration:
#objc(TestViewController) class TestViewController: UIViewController
We could instantiate the view controller just fine from another view controller using self.storyboard?.instantiateViewControllerWithIdentifier( "TestViewController" ) but when presenting the view controller (using self.presentViewController( viewController, animated: true, completion: nil )) the app crashed with the same "missing proxy" and "not key value coding-compliant for the key sceneViewController" error.
Our solution which we found after much frustrated trial-and-error-like debugging was simply make sure the view controller's Storyboard ID in the storyboard file is not the same as the class name.
When we renamed the Storyboard ID from "TestViewController" to "testViewController" (only difference being the lower-case first letter), everything worked…
Strange? You betcha, but everything seems to be working now.
I had the same problem. Try cleaning the project and restoring the simulator.
I was getting the same error with an app that I was converting from .xib files to storyboards. My app contained a UITabBarController, and tapping on certain tabs would trigger the error.
In my case, the problem was that I had copied view controllers into the storyboard that used the "NIB name" property to load the view controller's view from an external .xib file. Storyboard view controllers do not support loading views from .xib files, so my storyboard contained a view controller that had no view.
I opened the external .xib file, copied the view, pasted it into the corresponding view controller in my storyboard, and made sure that the pasted view was subordinate (indented under) the view controller in the storyboard scene. Then I re-connected the view to the outlets in the view controller.
When I re-ran the application, the error was gone.
Add me to the list. I get this error after "refactoring - rename" on a class. The class I am renaming is a custom ViewController with its own .xib. I use Storyboard which launches a viewController containing a "Container View", which has my custom ViewController embedded in it upon launch.
The only way out of this so far is to NOT use my refactored .xib (disconnect it from the container view).
My semi-solution:
I have restored my app from a prior working snapshot and created a new custom ViewController and .xib from scratch instead of refactoring. Connected it to Storyboard and I got the error message again. Cleaned the build and deleted the app from the simulator and re-ran, and then it magically ran without error. For this reason I believe there is a bug in Xcode with Refactor-Rename, which corrupts some storyboard file behind-the-scenes. Once I confirmed that the new .xib was attaching to storyboard without error, I copied/pasted the class code into the new custom viewController class, and went through the process of reconnecting the class objects to the .xib, as you'd expect. Ran it and everything still worked.
FYI - here are some of the FAILED steps I took in my attempt to recover from the error (before giving up and restoring snapshot).
1. Cleaning Build.
2. Deleting App in iOS simulator.
3. Deleting all views in the custom ViewController .xib.
4. Naming the custom ViewController something else.
5. In Storyboard, adding a blank view to the ViewController representing my custom Viewcontroller class. This worked and allowed my app to run, however my custom class was neither able to load its own views in place of this default blank view, nor were it's own views visible upon making the default blank view transparent. Debugging showed my custom class .xib views being nil when assigned to self.view.
I am presently avoiding Xcode's Refactor-Rename for files having a .xib.
I had the same errors, finally solved it.
My problem was that I had :
[[storyboard instantiateViewControllerWithIdentifier:#"TripDetail"] methodThatDoesNotExist:#"param"]
I created app with using storyboards. My app has a table, some buttons and labels.
When I try to run my app simulator generates an error: Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIViewController tableView:numberOfRowsInSection:]: unrecognized selector sent to instance 0x719de00'
UIViewController tableView:numberOfRowsInSection: means that I can't use "numberOfRowsInSection" with "UIViewController"?
I tried to use "UITableViewController" instead but with this controller I can't locate the buttons and labels in right place for me.
What I do wrong?
Thanks.
Once you Add the UITableView and set Datasource and Delegate, we must use some UITableview Delegate Methods. such as NumberOfRowsInSection, NumberOfSection, and so on.
Kindly Use the Essential Delegate Methods or Remove the UItableView.
You need to delegate the UITableView to the UIViewController, open the Connections inspector and drag the "delegate" and "dataSource" entries to the main view controller on the storyboard.
I have updated to iOS 5.1 and facing this problem. I have a Master and Detail viewcontrollers. Also I'm using a splitViewController.
The problem is when I launch the app in landscape mode, it shows this error
*** Assertion failure in -[UIPopoverController _incrementSlideTransitionCount:]
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'About to overflow slide transition count'
I am using ARC and the program runs perfectly well if launched in Portrait mode. Kindly provide me suggestions.
This is probably caused by the fact that somewhere in your code you are trying to show the Master ViewController. While this will be perfectly ok when launched in portrait (because the Master view controller is not initially displayed) it will cause problems for landscape because the Master ViewController is displayed, therefor "overflowing your slide transition count".
Without seeing your code I can't exactly tell you which section of code is causing this but you may want to get pass this error by doing something like
if(UIInterfaceOrientationIsPortrait(self.interfaceOrientation)) {
[run the code that is crashing your app]
}
This way your code will only be called when you need it (in a portrait orientation).
I am beginner of iPhone here come the error of run time of
Terminating app due to uncaught exception
'NSInternalInconsistencyException', reason: '-[UIViewController
_loadViewFromNibNamed:bundle:] loaded the "DetailViewController" nib but the view outlet was not set.'
give any suggestion and source code which is apply in my code....
it would be easier to help you if you could post the code of your uiviewcontroller. I guess you have some IBOutlets which aren't connected properly between your UIViewController class and the corresponding Controller on the Storyboard
You have to connect your root view of the nib file to the view property of the files owner (your DetailViewController).