Inconsistency in UITabBar items and view controllers detected - ios

I got a crash, described as follows:
Inconsistency in UITabBar items and view controllers detected. No view controller matches the UITabBarItem '<UITabBarItem: 0x14fa7cf60> selected'.
It seems that the crash occurred when the user clicked the tabbar and doesn't appear evey time. I only found it on multiple iPads of iOS 16.2. It should not be caused by the new app version, because the historical version also appeared. I guess it is caused by changes made to iOS 16.2 system.
Is there any solution?

Related

Xcode 9 Navigation bar issue after navigating from Left Side Menu on iOS 11 not on iOS 10.3 and below

After updating from Xcode 8 to Xcode 9 I've noticed this very strange behaviour in the navigation bar only on devices running iOS 11.
This bug appears after navigating from my left side menu that show the menu controller you choose modally with a default presentation (That is Full Screen)
I've posted a video here: https://youtu.be/mgjlbkMi-N8
It seems a bug of the compilation on Xcode 9.
Tryed also on real device iPad Pro with iOS 11.
The same code compiled with Xcode 8.3.3 works as expected, while compiled with Xcode 9 exposes the issue.
I've put a playground code here: https://github.com/shadowsheep1/xcode9navigationissue
With already a workaround: set the presentation to Over Full Screen.
But that has no meaning this is not the exptected operation.
Once the navigation bar is broken, is broken for every navigation controller in the App.
Any idea?
EDIT:
Apple Developer Relations January 23 2018, 11:13 PM
There are no plans
to address this based on the following:
You are creating a detached presentation, which is causing multiple
navigation bars to be placed in the view hierarchy. The navigation bar
that is seen is not the one where pushes are happening, thus the error
in display. I don’t know why this didn’t happen on iOS 10, but it was
an invalid configuration there as well.
We would recommend that you use a proper view controller container to
implement this menu, rather than what seems to be done (the
IS_SlideMenu_View being placed directly in the window).
I have the same problem with regular UIModalTransitionStyleCoverVertical.
I've solved it by setting UIModalPresentationOverFullScreen or UIModalPresentationOverCurrentContext.
Possibly it also helps you.
Example for navigation that is presented modally:
if (#available(iOS 11.0, *)) {
navController.modalPresentationStyle = UIModalPresentationOverFullScreen;
}

View Controller is not showing with Container View in XCode 8 StoryBoard

I'm building an app which using storyboard and designing view controller using container view. When i first designing, everything seems fine. But after i quit and restart the xcode, this problem is occurred like in image.
The View Controller is missing but the segue still exist, I have found out that somehow the view controller just hide somehwhere and if I delete the segue, the VC will show up again.
Is this a bug or somehow i screw up my XCode?
Thank you.
Looks like an Xcode bug. Lot's of bugs appeared in Xcode 8. Filing a bug report with Apple and updating to the newest version (even if it's a beta build) looks like the only solution for this.

Why are some iOS assets not showing at retina resolution?

In one of my projects, many built-in assets, such as the clear button in UITextField or UISearchBar objects, the UITableViewIndexSearch image, and the activity indicator in the status bar set by UIApplication.sharedApplication().networkActivityIndicatorVisible don't show at the correct resolution. I've noticed this on iPhone 6 and iPhone 6 Plus devices running iOS 8.4, as well as all of the simulators running iOS 8.4. I have other projects that don't show this issue.
Screenshots are here: http://imgur.com/a/7TMlE
I have experienced this as well, in my case the cause was various view controllers being created too early in the application life-cycle (in the init method of the app delegate, i.e. before didFinishLaunching had been called) and also before the creation of the initial UIWindow.
Moving view controller creation to didFinishLaunching, after the window has been created solved it.
Those are system elements, so that’s pretty weird. Try deleting and re-adding the simulators in the Xcode Devices window: Window → Devices or shiftcommand2.

Window's root view controller is not Split view controller

I am trying to modify my existing app to use a split view controller. I've followed the sample master/detail project structure by adding a split view controller into my storyboard, made it the initial view controller and everything seemed to be working fine, until I tried to run the app in an iOS 7 simulator. All of a sudden when I hit my breakpoint in application: didFinishLaunchingWithOptions self.window.rootViewController is now the type of my master view controller, not the split view controller itself.
I thought maybe then I just need to get the split view controller off of the root view itself and tried rootViewController.splitViewController but that is nil. I must have missed some set up step in enabling this split view controller, but I have no idea what it was.
It is because UISplitViewController isn't supported in iPhone in iOS7, only in iPad.
If you run your code in iPad iOS7 you will see your UISplitViewController.
Only in iOS8 Apple added support for iPhone as well.
So this ended up being a pretty obscure issue. It seemed to be caused by the way that the iOS 8 SDK and Xcode 6 handle storyboards and size classes. I intend to file a bug report with apple but the repro steps to get this to present are simple:
Create a new master/detail application
Set deployment target to below 8.0 (7/7.1 works)
Change application type from "Universal" to "iPad"
You have to comment out this line from the generated app delegate, it will crash in an iOS 7 target:
navigationController.topViewController.navigationItem.leftBarButtonItem = splitViewController.displayModeButtonItem;
Run on iPad simulator for iOS 7.1
The fix to this issue is to disable size classes on the storyboard. I theorize that the way that Xcode 6 and the iOS 8 SDK are handling size classes for iPad versus universal app builds causes this to not work on iOS 7 targets, but turning off size classes fixes the issue.

Weird Bug in XCode StoryBoard after upgrading to iOS SDK 7.1

Last night I updated XCode and the iOS SDK.
It looks like it messed up the UINavbar on the storyboard, here is a pic:
It shows two titles overlapping, if I delete the title , then there is still another one in the background, Im not able to remove that second one.
The strange part is it magically disapear, if I run the app.
XCODE version --> Version 5.1 (5B130a)
iOS SDK---------> Version 7.1
Yes, there's a new property for the uiviewcontrollers named "exteded edges" you must uncheck this in the interface builder inside the uiviewcontroller preferences. Or by inserting this code in your view did load. This will tell the controller not to draw the view under the navigation bar.
if ([self respondsToSelector:#selector(edgesForExtendedLayout)]){
self.edgesForExtendedLayout = UIRectEdgeNone;
}
I checked again and there was an extra navigation bar, its weird that It shows only after I upgraded, I think something happen with that view because I embedded it into a navigation controller.

Resources