how to come out this situation [duplicate] - ios

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Applications are expected to have a root view controller at the end of application launch
I working on a splash screen in that new subclass tableview included in window, I got this type of runtime error"Applications are expected to have a root view controller at the end of application launch"
any suggestion and source.

It's harmless if your next viewController is being invoked. I've tracked this down and the issue is that if the method didFinishLaunchingWithOptions completes prior to the setting of the property, the runtime throws this error.
I have apps that must validate the user before loading a viewController so this property is set later with no harm.

Related

Adding dynamically current year in a Label in LaunchScreen.xib in iOS [duplicate]

This question already has an answer here:
iOS: Update launch screen dynamically
(1 answer)
Closed 4 years ago.
Is it possible to add the current year dynamically to a Label to show "Copyright current year" in the LaunchScreen.xib in iOS using Objective C? If yes, could you please write the steps needed?
From my knowledge, I think the LaunchScreen is only to display static contents but after going through few articles they said it can be done but I didn't get a clear answer. I know this is a duplicate question in StackOverflow but still hoping to get some help. Thanks!
You can't display any dynamic content inside the launch screen , but you can create a splashVC as the rootVC that you add to it what you want and by setting a timer/ dispatch / delay inside that splash to navigate to the mainVC of the app

Replace Launch screen text on each app login [duplicate]

This question already has answers here:
Execute code in Launch Screen
(4 answers)
Closed 4 years ago.
I want to change the text of a label in the LaunchScreen.storyboard on each application launch. The problem is that when I am trying to set a UIViewController to the LaunchScreen.storyboard I get this error:
"Launch screens may not set custom classnames".
My goal is to show the user hidden features of the app while he waits for it to load (every time a different one).
You can't assign custom VC to that launch (only static images or text dragged from Object Library ) , if you want to make splash make it in the rootVC then navigate to the mainVC

Is there a difference between viewDidAppear in iOS 7.1 and iOS 8 that would effect setting up a variable?

In iOS 7.1 I set an integer variable in my viewDidAppear method. It works at first, but after navigating to another view controller and navigating back my integer variable is now set at zero. If I move integer variable setup to viewDidLoad it works every time.
In iOS 8 it works every time in the viewDidAppear method.
Why would this work in 8, but not 7.1?
I can't speak to the question of the differences between iOS 7 and iOS 8 in regards to viewDidAppear, here are some what I hope are useful links to take a look at.
There was a question answered that addressed the call/event cycle that contains a graphic that you may find useful:
iOS 7 - Difference between viewDidLoad and viewDidAppear
And this link has a reference to a UIViewController using a UINavigationController that, in turns, manages other UIViewControllers and the viewDidAppear message was getting lost in the hierarchy. The fix was to ensure that the navigation controller explicitly called viewDidAppear so it would be passed it to the child views.
http://davidebenini.it/2009/01/03/viewwillappear-not-being-called-inside-a-uinavigationcontroller/
Not sure of your exact situation, but hopefully these will help.

Weird Error of UITextField and UIWebView [duplicate]

This question already has answers here:
UITextField -webView no longer supported
(2 answers)
Closed 8 years ago.
I just got another weird thing after upgrading to Xcode 5.1… As I am typing in my UITextField, a message is displayed in the console saying
UITextField -webView called. This method is no longer supported with the new text architecture
What kind of a message is this..? UITextField..UIWebView… oh come on… this Xcode 5.1 upgrade is giving me all sorts of issues…
Thanks in advance.
Thanks to "Patrick Goley"
Previously, UITextfield used a UIWebView internally for rendering rich text. This has been done away with the release of TextKit (or as they say it, "the new text architecture"). If you need to render web content, this should certainly be done by creating and using a UIWebView directly.

iOS7 UIToolbar crash

I have an iPad app that has been running fine until iOS7. This issue seems to be only on ipad 2nd gen models and earlier when iOS7 is installed. Anyway, I've been tearing my hair out trying to figure out where this error is coming from, but have had no luck. The console in xcode (5) reports the following error after I perform a logged in segue:
2013-11-18 11:17:31.768 MyApp[400:60b] *** -[UIToolbar backdropView:willChangeToGraphicsQuality:]: message sent to deallocated instance 0x18ec23e0
I can't lookup the address for more info (image lookup -a 0x18ec23e0) it just returns nothing.
In instruments running zombies, it reports that a message was sent to a UIToolbar like so:
When I inspect the instance, I get the following:
How do I debug this? I have no idea where this call is being made and it seems dependent upon a physical deivce (doesn't happen on the iPad mini or ipad 3/4)
I was struggling with a very similar error, also with a UIToolbar, that I couldn’t figure out until a couple hours ago. I also had to use and try to understand the zombies’ instrument but without any luck.
What I did was to pay a close attention to the call stack that was presented when the Exception Breakpoint was activated as described in the following tutorial:
http://www.raywenderlich.com/10209/my-app-crashed-now-what-part-1
Even though the call stack didn’t point me to the exact code line, I noticed that the app was trying to add a UIToolbar to a ViewController. Turns out that what I was doing was creating a local UIToolbar inside of a method and adding it to the presented UIView. After have modified this behavior, I stopped having the annoying sudden crash. It was difficult for me to find the issue because looking at the code of the ViewController that caused the crash, there was no code that created or used a UIToolbar; however this VC included a custom view that did exactly that, as I explained before.
Have said all of this I recommend you to closely inspect the VC that generates the crash. If you need to create a UIToolbar programmatically I recommend you to declare it as a strong property to maintain the memory reference as long as needed.
I hope this helps you.
I struggled with this for a while today. I had two storyboards, one for login/signup (set as the main storyboard for the project) and another with the rest of the application. The app delegate would detect if a user was logged in and instantiate the root view controller of the other storyboard. The root view controller of the login storyboard is a navigation controller and after after some investigation with instruments I realized there was a UIToolbar being instantiated from the nib. Opening up the storyboard file revealed an off-screen UIToolbar object in the root view controller. I deleted it and I'm not crashing any more.
I should also mention this crash was only occurring when I was using MKMapView.

Resources