Take a look at Apple's documentation about running code in the background.
http://developer.apple.com/library/ios/#documentation/iphone/conceptual/iphoneosprogrammingguide/BackgroundExecution/BackgroundExecution.html
There are several different ways to get closer to your tasks. The only applications that can have completely background processes are the audio, voip, and location applications, and this needs to be declared in Info.plist.
If your application is not of this type, it will probably be difficult for you to do what you want easily. There are methods that allow you to keep your application in the background for a limited period of time (also via this link), but ultimately your application will be disconnected.
Local notifications will prompt the user to open the application - do you really want a warning message to appear on the phone every 30 seconds?
source share