I got this error in console .can any one tell me What kind of error is this.."Terminating in response to SpringBoard's termination".
that's when the app gets terminated by the ios for high memory usage or the springboard crashes( springboard is application that manages the other applications...aka..home screen), or you quit the app
if you have the device jailbroken you can get that pretty often
did you get the springboard restart alert?
I had the same problem and accidentally it appeared that my code was still trying to do some action (in my case it was generating data for AudioUnit buffer) when I was quitting my app. I have just quit this generating in dealloc method and all looks much better. No warning.
Related
How can I check if user has exited the app, so I can make sure the app will shutdown?
I am currently using Swift - Xcode 6.3.1
In the AppDelegate class (AppDelegate.m) there is a function called applicationWillTerminate:(NSNotification*)notif. This function will be called when the application has been quit. This is where you put any code that you have to call before quitting the app (e.g. closing files, deleting timers, etc). This is automatically called when the app closes, you don't have to check yourself.
In iOS you don't (in general) terminate an app. You should design your app such that if the user moves away from it (e.g. presses the Home button) that it is ready for when they decide to come back. You also need to design it such that if iOS terminates it (e.g. due to memory limitations) that no user data is lost and that all is right next time the app launches (the general guidance here is that the user cannot tell that the app terminated - but a lot of apps don't succeed in that). But otherwise you do not need to do anything when the user 'goes away' from your app.
See this Apple document for the official line on not terminating. See this Apple document for more details on the App lifecycle in iOS.
The sole exception is that you may want to terminate if a fatal error occurs - in Swift you can use fatalError to do this, but it will look like a crash to your user.
I have Weird problem,When i close my app via task manager , my app gets crashed on the line
int retVal = UIApplicationMain(argc, argv, nil, #"AppDelegate");
throwing "Thread : 1 signal SIGKILL" error,and i can't reopen my app at all. other times it works pretty well.
Please some one help me with this problem.
I am new to cocos-2d so please be gentle :( , thanks.
As far as I know, this is normal, expected behavior. The reason it seems weird, I think, is that when you run from Xcode, your executable is attached to the debugger in Xcode, so it sometimes prevents things from executing (for example, in a crash or SIG_KILL scenario). This is just giving you a hint as to what apple is doing when you use the task-bar to close the app... it sends SIGKILL to the process :-)
EDIT: for the curious, I tested a little and found that applicationWillTerminate: is not called first, which is actually encouraging as a consumer of apps. You really are SIGKILLing these things. I think this means (with the background-processing workflow) that the only case when that method will be called is if you opt out of background execution. The good news is that in order to kill an app this way, you need to move it to the background first, so the canonical place for teardown is applicationWillResignActive: but you knew that...
EDIT: instructions for avoiding the can't-run-again issue:
Build and Run the app on your device from Xcode
As soon as the app is "up and running", click "stop" in Xcode
When the app has closed, it is now "detached" from Xcode and you can terminate it and re-open as often as you wish. Just keep in mind that it will no longer log to Xcode any NSLog calls or otherwise.
so when i'm running my app using XCode and I can see that my app gets "program received signal 0".
However , the background thread are still running. why is that ?
Second, I can't seem to find any solution to this problem.
I assumed it might be memory leak, but I see nothing special using LEAKS (instrument).
When I run the app on the device(without XCode) and then try to see the device crash inside the organizer, most of the times there is no log (I guess maybe because the app is still running and only the main thread crashed) and while there is a log, my app function are only hex addresses without names.
What other options do I have to solve this issues ?
Thanks!!
I've found that sometimes these errors are caused by trying to access deallocated memory. One great tool to debug these issues is NSZombieEnabled. Here's a link to a good explanation of how to use NSZombieEnabled: CocoaDev: NSZombieEnabled
My app is crashing with the following message in the Xcode debugger:
Watchdog has expired. Remote device was disconnected? Debugging session terminated.
The Debugger has exited due to signal 15 (SIGTERM).The Debugger has exited due to signal 15 (SIGTERM).
The crash is quite severe and reboots the device most of the time. The debugger just exits and I get no crash log afterwards.
Is the "Watchdog has expired." message relevant at all? Or is this just an artifact of the debugger loosing touch with the app when it crashes?
If it is relevant, what does it mean?
"Watchdog has expired." could mean anything. The way the message is worded suggests that the "local" GDB (running on your Mac) GDB timed out waiting for data from the "remote" GDB (running on the phone). Alternatively, "Watchdog has expired" might be from the phone's console output shortly before it reboots.
What does it display if you disconnect the device while your app is running? What if you power it off? What if you issue a hard reset (Sleep+Home for 10 seconds)?
If it's causing the device to reboot, there's something seriously wrong happening. Your app shouldn't be able to take the phone down, but sometimes something slips through (IIRC, UIImagePickerController on some version of 2.x had a problem where either your app would get killed or the phone would reboot, depending on which kicked in first). "Large set of bitmaps" sounds like it might be causing CoreAnimation (or IOSurface or whatever) to run out of video memory.
I would hesitate to do drawing in a background thread unless you're very careful about thread-safety (to a first approximation, CoreAnimation is and UIKit isn't except a few functions that were made "thread-safe" in 4.0).
I have a question,
i carefully went through and thoroughly understood the tutorial for iOS Core Data.
The issue was that when i coded everything and run on iOS 4 with multitasking.. the program crashed when i re-opened it (kill task from fast app switching and relaunch)
Then i went curious and recode it on iPad (since it hasn't support multitasking) and it works fine...
I went to explore abit, and some says that the fast app switching kill app is like the OSX kill app and there is applicationTerminate method in the delegate file which maybe need some changes (based on the comment).
Could someone enlighten me on that issue? Is there anything additional that i need to do in order to have Core Data to support the Multitasking feature..
Thank you!
Update
Ok but the thing i am not getting is that.. once i killed the app.. go Fast App Switch, kill it... and when i re-run the app.. it crashed.. Do i need to add some stuff to the multitasking methods? It crashes even if its a basic app with 1 button... What are the states that i have to save?
Update
The app just freeze on its own
Update
Alright my bad, trying my best, for the one button app... I sticked a button in there, and for each click, it prints an NSLog and a label. When i build and run it, it works fine, clicking it prints them normally. After going to background and close the app.. it sends SIGKILL Then when i relaunch the app, it no longer prints to NSLog and crash there 0x98a450f0 <+0000> mov $0xffffffe1,%eax 0x98a450f5 <+0005> call 0x98a453d8 <_sysenter_trap> 0x98a450fa <+0010> ret 0x98a450fb <+0011> nop
Update
However when i open the Iphone simulator and run the program directly... without building it from xcode.. It works just fine and it was able to print that value. Same is true for the Core Data.. if i just run it from the Simulator. Kill it and re-run, it works fine.. Not sure what's going on
With iOS 4.0, your app may not receive a -applicationWillTerminate call. It may only receive a call to go into the background and then be killed.
When you get the call to go into the background you should dump as much memory as possible to avoid being killed, that includes saving your context and perhaps calling reset on the context to get it to drop its cache.
Other than that, no changes need to be made.
What crash are you seeing, a stack trace would be helpful to explore this further.
Update
Again What crash are you seeing?
Update
Freezes where? Where does it stop when you look at it in Shark or the debugger? You are not giving me a lot of information to go on here :)