iPhone OS4 has been introduced with a new important feature which is multitasking.
Multitasking and the ability to run program in the background opened a new development field for iPhone developers, so I just wanted to blog an introduction tutorial to develop an application that runs in background.
When an app According to the iOS Application Programming Guide, if the device doesn't have iPhone OS4 or later versions it will not support multitasking and the application delegate will receive the
applicationWillTerminate: message instead of applicationDidEnterBackground: .
I attached a project that demonstrates the multitasking capabilities, find it here .
In The "AppDelegate" class, you will notice the new messages that the application sends to notify the delegate of its foreground/background states.
I added logging message to show the sequence of calling these messages.
In the applicationDidEnterBackground: message you can perform some tasks to wrap up your work, and the framework only gives you a small amount of time to complete wrapping your work, so I tested that on the simulator and it gave me about 10 seconds to complete my background task until my application is purged from memory.
Also I add 2 alerts to demonstrate the new local notification feature, it's very helpful feature when it comes to alerting the user at a certain time or after a certain duration. The alerts will be registered when the AppDelegate executes applicationDidEnterBackground message.
I tried to keep it simple and quick for you to start working with background feature and local notification feature. For more info please see the reference .
Everyone wants to have an effecient logging method that releave him from the stepping debugging.
The following is a macro for debugging showing only in debug mode.
- Current File.
- Current Function.
- Current Line.
- Custom Argments.
Ex: ALog(@"Hello world") will print:
Reference: http://stackoverflow.com/questions/969130/nslog-tips-and-tricksRead More
I have experienced some useful Chrome browser extensions, I hope that they help you.
You can add other useful ones that you have tried.Read More
If you need your terminal to always open on a certain directory or to execute any command every time it starts.
open your terminal.
cd <directory> to /Users/<your user name>
sudo vi .profile
write commands to be executed every time you open your terminal.
I wrote: echo 'بسم الله الرحمن الرحيم'
I hope it helps.
Route-Me works with OpenStreetMap, Microsoft VirtualEarth and CloudMade with support to offline browsing, on the other side the MapKit framework is limited to Google Maps and does not support offline browsing. During the development of an iPad application.