My app works fine when launching from XCode, and it starts back up from a saved state fine, but the problem is when I open the multitasking tray and manually close the app. After closing the app this way, when the app reopens it doesn't start from the loading screen, it starts from the screen it was at when it was closed, but it is frozen and pushing the home button from this state causes springboard to crash.
My first thought was that the app was taking too long to open, so in the applicationDidFinishLaunching function I load data in a new thread (I have also tried performSelectorInBackground and performSelector after delay) and this works fine except for the strange problem described above.
Also, nothing is written to the device log and no crash report is created.
Any help with this would be greatly appreciated, Thanks.
Is the Xcode debugger still attached when you shut down the app? That would cause the behavior you're seeing when you terminate the app from the task bar.
Related
Our company has an app which is basically an eBook reader.
We use the RMSDK to perform book downloads & read.
Now, something very strange is happening in iOS7 devices (not in the simulator):
I download a book using the fulfillment method in the RMSDK
I wait for the book to finish downloading. The book is saved in the NSCachesDirectory (for App Store guidelines reasons) - so far, everything works fine
I hit the home button, the app moves to the background
I hit the app button to bring the app back, that's when the problem happens:
The app gets completely stuck. Hitting the home button does nothing, hitting the power button shuts down the screen, but then hitting the power button again does nothing.
The device itself has effectively crashed.
After a few minutes, the Apple logo appears on the device and the device comes back to life after a reboot.
I have no idea what in my code could be causing the device to act this way. Shouldn't the iOS7 sandbox prevent me from being able to crash the whole device?
Any ideas on why this could be happening and what I can do to prevent it would be greatly appreciated.
EDIT:
I placed a breakpoint on the -(void)applicationDidBecomeAcvive: method in the AppDelegate, and it's not being called when clicking on the app icon in the last phase before the crash.
EDIT:
The RMSDK is using libcurl to download the books. Could this be a cause for this behavior?
EDIT:
The problem is happening if I click on ANY app after I click on the home button, not just on the same app. So for example, I click on the home button, then I try to open Fruit Ninja, and the device crashes.
We managed to solve this issue by disabling functions in RMSDK, which call mkfifo(). I'm not sure how much I can say here due to NDA but they're all located in one file and can be cleanly converted to no-ops with a nice preprocessor #if defined()
Its an OS level bug. iOS 7 is still unstable in areas, for example my Apps report crashes in places that are part of iOS 7 itself and couldn't be caused by my app.
I have very weird problem. My app works cool on simulator but when installed on iphone it shows strange behavior
Suppose i was at settings page then I closed the app using home button. And then I start the app again after quite a while and I will always first get the settings page for one second and then the main loading screen. This happens for every other page even its not the settings ViewController
What is wrong?
Best Regards
Umar
Standard behavior, UI restoration. Your iOS apps picks up execution right where you left.
This means: if the app is pushed to background, a screenshot is taken. Coming back to the app, this screenshot will be shown and meanwhile your UI gets prepared.
If you have code in your app in applicationDidBecomeActive: or applicationWillEnterForeground: (see here: http://developer.apple.com/library/ios/#documentation/uikit/reference/UIApplicationDelegate_Protocol/Reference/Reference.html) and that will immediately reconfigure the UI, you get the behavior described.
You can turn OFF UI restoration and have your app really quit instead of pushing it to background by changing a key in the info.plist: UIApplicationExitsOnSuspend
Ok, I'm confused..
I have an app that if I launch and use runs fine.. However if I click on the home button pausing the app, and then go into the list of running apps by double clicking the home button, and then delete the app instance in that list, effectively killing/ending that app run, and go back and click on the icon to launch the app fresh, the app simply hangs with a blank black screen... every time I try to start the app after that first time I get this problem.
Is there some event I need to handle in my app, to make sure it cleans itself up properly for relaunch?
I am admittedly confused and would appreciate any help.
I had the same weird problem, then i have realized that this only happens if you run the application through the XCODE (Debug Mode).
The application locks because the debugger/xcode receives the SIGNKILL and locks the application so you can inspect the code.
If you run the application directly from the device the application gets killed and does not remain locked on the screen :)
Even one year later, i had the same problem, so hope that helps someone that has the same problem.
I'm developing an iOS app with core data.
Every time I kill the app (by pressing the home button twice and kill)
then when I load the app again, the view is the same as before (maybe because it was restored successfully) but it's stuck without any error... if I press home button again then the screen becomes black and I can't see anything....
just the threads in Xcode and the status is "running"...
Anyone has an idea? or somewhere to start digging in?
Thank you!
I know this problem. It is because of Xcode 4. Here's the deal => Try running the App in the iPhone/iPad and you will not have that problem.
From my experience, the problem exists with the iPhone simulator and it works on the device !!
When i start my app for the first time after installing it and exit before the splash screen disappears, from then on launching from the multitasking menu it comes up with a black screen. If I click on it from the home screen it loads fine but every time I try from the multitasking menu it is a black screen until I terminate it. If I add the UIApplcationExitOnSuspend property to the properties list the black screen continually appears until i restart the device. Any help is appreciated.
Thanks Sj
A couple things:
You probably don't want to suspend your app prior to the splash screen disappearing. applicationDidFinishLaunching is running code (you know, like adding a window to the app) while the splash screen is showing. If you suspend it early, it doesn't have a chance. This may not be the case after the first time install but if I were you, I'd give it the time it needs to do initial install instead of interrupting it.
Another less likely scenario: Are you doing this while the debug is still running? I've only had an issue similar to this (black screen after suspend) if I leave debug running and then suspend the app to the background. As soon as you bring it back out of the background, you get a black screen, so in that case it's a bug. If you hit the stop sign button in XCode to kill the app, it worked fine after that.. but you have to kill it before suspending it.
My guess is your likely cause is #1. Give the app more time to do the initial load. After that, it should be fine. For whatever reason, the first time installing/loading is always the slowest.