iphone ios application home button press/applicationDidEnterBackground crash - iphone

hallo, i am newbie in developing iphne/ios application and i have
encountered some problem
generrraly my app (which is iphone camera image processing app) has no
visible errors at today stage except the one
when i press the home button to send my app off screen (putting to the
background), and then press the app icon to 'wake it up' again
it crashes
what would it be...? what the reason of it would be?
what is done to my app (seen from the view of programmer
- i mean internal game state) by this home buton operation?
- what i should take care of before "applicationDidEnterBackground"
eventually?
thanx for answer

Is this happening when you are running it from Xcode? Xcode does not like it if you hit the home button and start it again from within the device/simulator. Is it crashing if you launch it from the device (or simulator) without Xcode running? If not, then there probably isn't a problem.

Related

iOS7 - App causes device (not app) to crash

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.

AIR app still running when the iphone is blocked?

I just made a simple game with flash professional 6.0 and adobe AIR sdk 3.4 for iPhone.
The problem is this: when I lock the iphone pressing the power button, the screen switches off as usual, but the music of the game still sounds. If I exit the game pressing the home button it exits fine. Is only when locking the phone with the app opened.
Also, I opted-out of multitasking for my app, so if I close my app with the home button and I reload it, it loads the main menu.
Anyone knows how can I solve this?
Ok, after a lot of reading, it is a very very simple solution, just with this at the start of the app:
SoundMixer.audioPlaybackMode = AudioPlaybackMode.AMBIENT;
With this playback mode, the sound mutes when the app goes to the background.

My simulator crashes when I try to terminate my app from the recent-apps bar

My simulator crashes when I try to terminate my app from the recent-apps bar.
When I hit the home button and then my app, the app goes back to where it was, just like it should.
But when i hit the home button, and then the home button twice, and then holding my app and press the (-). The simulator goes in the background and xcode says it crashes. When I hit my app on the simulator now, the simulators screen goes black and won't load anything, and xcode is coming up with a crash message again.. and the simulator is frozen on the black screen...
What do you think is wrong?
It's nothing to worry about. This is a normal feature of XCode debugging session.
Make sure you stop the debugging session in XCode (hitting the stop - black square - button) and run your application again directly from simulator (not from XCode). It should work now.

ios Kill app 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 !!

Home button doesn't exit app in iPhone simulator 4.0

I noticed that when building then running viewDidLoad only gets called once. If you press the home button and re-enter the application, viewDidLoad does not execute again.
Another thing I noticed is that when you re-enter an application it starts off right where you left off.
Is this the same behavior as in older SDKs? Does this mean that when the home button is pressed the application did not really exit?
When you press the home button, debugging is terminated and therefore you will not see anything from NSLog in the debugger console on any version of the SDK. You can try this by putting an NSLog in viewDidAppear:, which should get called even if the app is still running in the background in iOS 4, but doesn't
One difference with iOS4.0 is that if you press the home button your app might not necessarily terminate. The default setting is that they that will still be loaded in memory. This is the new 'multi-tasking' feature of iOS4.0. Turn it off and your app should be loaded every time.
UIApplicationExitsOnSuspend is the key for your plist to enable/disable background running.
With new iOS 4, multitasking arrived on iPhone and iPod Touch...
For this, when you are debugging or developing an application with the iPhone Simulator, if you press the home button, your app go in background or multitasking. Than Xcode believe that your app is still in use.
For recalling viewDidLoad method, you must completely exit from your app by pressing twice home button then hold down your app in the multitasking bar and tapping on the X.