IOS 4 Core Data ... any changes with multitasking?

My question is, I carefully looked through and completely understood the tutorial for iOS core data.

The problem was that when I encoded everything and ran it on iOS 4 with multitasking .. the program crashed when I opened it again (kill the task from quickly switching applications and restarting)

Then I became curious and transcode it to the iPad (since it does not support multitasking), and it works fine ...

I went to investigate abit, and some say that a quick application to switch applications is similar to an OSX removal application, and there is an applicationTerminate method in the delegate file, which may need some changes (based on the comment).

Can someone enlighten me on this? Is there anything extra I need to do to make Core Data support multitasking?

Thanks!

Update

Ok, but the thing that I don’t get is that .. once I killed the application. Go to the Fast App Switch, kill it ... and when I restarted the application .. it crashed .. Do I need to add some things to the multitasking methods? It crashes even if its basic application with 1 button ... What are the states that I have to save?

Update

The application just freezes on its own

Update

It's good that I'm bad, I try my best for a one-button application ... I clicked a button there, and for every click it prints NSLog and a shortcut. When I build and run it, it works fine, clicking it usually prints them. Going to the background and close the application .. it sends SIGKILL. Then, when I restart the application, it no longer prints to NSLog and does not reset there 0x98a450f0 <+0000> mov $ 0xffffffe1,% eax 0x98a450f5 <+ 0005> call 0x98a453d8 <_sysenter_trap> 0x98a450fa <+0010> ret nxop

Update

However, when I open the Iphone simulator and run the program directly ... without creating it from xcode. It works fine, and she was able to print this value. The same is true for Core Data .. if I just run it from Simulator. Kill him and restart, it works great. Not sure what is going on.

+6
ios objective-c iphone core-data
source share
1 answer

In iOS 4.0, your application may not receive the -applicationWillTerminate call. He can only receive a call to enter the background and then be killed.

When you make a call in the background, you should dump as much memory as possible so as not to be killed, including saving your context and possibly calling reset in the context to make it discard the cache.

In addition, no changes are required.

As you can see, a stack trace will be useful for further study.

Update

Again What accident do you see?

Update

Freezes where? Where does it stop when you look at it in a Shark or debugger? You do not give me much information to continue here :)

+1
source share

All Articles