Deadlock/hard freezing on UITextField/UITextView/UISearchBar becomeFirstResponder - ios

I'm experiencing intermittent hard freezing of multiple apps on UITextFields, UITextViews and UISearchBars becomingFirstResponder. The freeze happens before the keyboard comes onto the screen. The app does eventually seem to recover, but takes a very long time. Most users will loose patience before this happens however.
The common factor between the apps seems to be registering for UIKeyboardWillShowNotifications, but a trivial amount of work is done in the selectors registered for this notification.
Is anyone else seeing this and/or found a solution?

I had same problem. In my case, it wan only iPad and stuck on [textView becomeFirstResponder] for about 3 minutes. I delete the app and downloaded my app from app store and confirmed the live version does not have the issue. I went back to Xcode and run after restoring all changes I made to fix the bug. Everything works fine now.

Related

Why does my iOS build behave differently after closing and restarting the app

We have a hybrid app that is a mix of Objective C and Swift that is showing some strange behavior in classes that haven't been touched in a long time. If we do a fresh build from Xcode the app works fine, but if we close the app and restart it, it behaves totally different. We re-attach the debugger and have seen viewWillAppear called but viewDidAppear is not called after re-opening. Other things like NotificationCenter Observers don't fire after closing and re-opening either. We've tried to track this down and I wish there was code that I could share that would point in the right direction, but it's a general thing in the app that is happening across most classes. When building for test flight it behaves the way that misses the viewDidAppeaer and the observers.

Why is Electron app slow after inactivity?

I have an Electron app (running on a Mac) that waits in the background for a key press, before showing a window.
If I leave it in the background overnight and then use it, it will be very slow for the first 10 seconds or so. It seems like updating the DOM and inter-process communication are both slow. The delay isn't coming from my code, and it seems to affect the renderer process primarily. After the initial slowness, it starts working normally.
Is there any reason that an Electron app would do this? Is it getting unloaded from memory somehow?
What's odd is that the initial display of the window happens instantly; it's just after I start to do some inter-process communication that it slows down.
There are a few possible answers to this, but after spending countless hours figuring it out, I thought I'd share the one that worked for me.
I was showing an animated SVG when I put the app in the foreground, and hiding it when I put it in the background. Apparently this was queueing up animation frames even while hidden, and then un-queueing them when it was shown, causing the delay.
It was fixed by upgrading Electron from 8.5.5 to 9.0.0, which I believe upgraded Chromium from 80.0.3987.165 to 83.0.4103.64. Not sure what the exact fix was, but it worked.

How to debug intermittent slow iOS iPhone app load times in Xcode?

I have an iOS Xcode project that previously would load fast, but from time to time, now will hang for five seconds or more during loading. When the app is run on an iPhone, the launch screen displays instantly, but sometimes, not always, and unpredictably, the app just hangs for around 5 seconds or more until the actual interface is displayed. It occurs both on the simulator and device across different iOS versions 7, 8, 9.
Recently, a UIView's class that contains a drawRect function was changed slightly, it has an outlet connection to one of the ViewControllers, but no significant changes made overall. One ViewController has code in the ViewDidLoad, ViewWillAppear, ViewDidAppear functions. All these things I'm investigating if they are impacting the load time.
When I terminate the app, the next time I try running it, it loads super fast without issue. I have no idea what to make of this load behaviour.
Questions
1 - What methods can I use in Xcode to debug an app that loads slowly at irregular and unpredictable times?
2 - What obvious items should I be on the look out in the project that typically cause slow or prolonged load times?
3 - Does Xcode include tools to monitor the processes operating live while loading occurs?
4 - Is it possible to print output for load processes I can review?
Any experienced advice really appreciated. Thanks.
Not sure if you have looked instrumentation. It is the best way to determine this kind of issues with your app.
https://developer.apple.com/library/watchos/documentation/DeveloperTools/Conceptual/InstrumentsUserGuide/index.html
When I terminate the app, the next time I try running it, it loads super fast without issue. I have no idea what to make of this load behavior.
Do you mean exiting the app? Or actually killing it? Cause if it is the former, then the reason is the app was just launched from a suspended state.
I would suggest take a closer look at didFinishLaunchingWithOptions:, and check if you are doing something that takes more time than needed. Run your app with the time profiler instrument, it will tell you where is your bottleneck.

App Store Rejection – App works in testing but not when sending to the App Store

Boy, this is frustrating.
I sent in my app to Apple after months and months of development. It was quickly rejected due to the fact that they said it was unresponsive at the home screen. Here is the screenshot they sent me:
Now, when I build the exact archive of the app that I sent them, I have no such issues:
The buttons were created in the storyboard file and were IBOutlets, but the highscore label that you see was created programmatically. Is it possible that the storyboard file didn't upload properly? I have already messaged them in the resolution center about it and tried to submit it again to see if it would work next time, but I was wondering if anyone knew anything about this issue.
From above screenshot, I've understand something that issue related with network error. See, they were tested with flight mode. According to apple guidelines, it should be go on in home screen without much more delay. At least show an alert for this issue. Just test with this scenario, you will get this.
When they said it was unresponsive, it may be due to the fact that its stuck for certain reasons, check if you make any API call at the viewLoad method, also, if the UI may turn unresponsive incase you are performing some heavy operation on the main thread, try using a background thread of these operations
It's been an extremely long time, but I thought I'd say what was wrong in case anyone comes across this in the future. Basically, I had created the buttons in Interface Builder but was re-instantiating them in viewDidLoad of my view controller. Since IBOutlets are weak properties, they were thus being released. Why that wasn't happening when I ran it on my computer, I have no idea. Still puzzles me to this day.

Significant delay launching app from Springboard

When I tap my app icon to launch it, it takes 0.5-1.0 seconds after the tap before the app actually opens from the Springboard - in other words, there's a significant delay between tapping the icon and the Springboard zooming into the app's launch image. I'm not seeing this with any other apps on the device (iPad 3). This is also happening on the iPhone 4, but not the iPhone 5.
In addition to this happening on first launch, it also happens when the app is backgrounded.
I went through and made sure there wasn't anything expensive going on in applicationDidFinishLaunching or appBecameActive - I even tried deleting everything except assigning the view controller to the UIWindow's root view.
Has anyone ever seen anything like this before? Any ideas on how to fix it? Thanks!
If I read your statement
"significant delay between tapping the icon and...launch image"
then it's something that Springboard is dealing with. In other words, the delay is before your main() is called, so it's likely an issue with your app's static characteristics, either something declared in the info.plist or something with Springboard's ability to just load the app.
Some things I would check:
info.plist is well-formed and doesn't contain unnecessary references or other tags;
launch images are not crazy large;
the .ipa is not crazy large;
As xmlhack mentions, that you don't have something odd happening with static variables.
I've found at least one reason why there can be a delay. Provisioning profiles. Lots of them.
I've had more than 400 of them when I thought about it. Removed all old ones and AdHoc and developer builds start time returned back to normal.

Resources