I am new in iPhone application and have no iPhone to play with. I have looked online about iPhone 4 has multitasking but previous iPhone doesn't. In previous version iPhone, is there no chance of having application running certain task at the background.
On the internet, I saw some link saying iPhone only allow app run in the background within 10 mins or something before it terminated the application. Does this mean iPhon开发者_JS百科e 4 or earlier version.
I am asking these question because I want to write an app that require user to upload the files to the server but don't want to stop the users to do other things: Using other application while our application sending file at the background.
Any help?
First off, the iPhone 3GS also supports background process and multitasking.
Its true that when Completing a Finite-Length Task in the Background it will only work for 10 min if you app has been backgrounded.
So if you implement it this way the file your app is uploading will continue to be upload if the app is backgrounded. but be aware of the 10 min restriction.
Also the simulator is not the best way to test these thinks because it does not really emulate an iPhone, it just more of a host for iOS application.
you should read this documentation: http://developer.apple.com/library/ios/#documentation/iphone/conceptual/iphoneosprogrammingguide/BackgroundExecution/BackgroundExecution.html#//apple_ref/doc/uid/TP40007072-CH5-SW4
There is, AFAIK, no way to perform arbitrary background tasks beyond a restricted set of things explicitly offered by the framework (e.g., tracking GPS events). Your app gets a chance to put itself into an idle state, but it can't just keep on chugging away in the background, doing whatever it wants.
But don't take my word for it; there is no substitute for playing with it yourself. Use the emulator.
精彩评论