What is an AppDelegate?
Recently I needed to call an external process after an iPhone app I have been working on finished loading uploading tracking information to a web server.
The way to do this is by creating a custom class and then calling that _NAME_AppDelegate.m file within your code, but what is an AppDelegate?
The AppDelegate just sits there doing nothing, waiting to be told that something potentially important has or will happen. The application/iPhone OS is the one doing the work and calling the AppDelegate when it has or will do something that the AppDelegate (and by extension, you) might want to respond to in your code.
Here is a complete scenario:
(Starting at the iPhone’s home screen)
1. A user taps on your app’s icon.
2. The iPhone OS loads your app into memory and whatever else it needs to run your app. At this point, the OS has control.
3. The iPhone OS finishes its launch procedure with your app, and is ready to hand over control to it.
4. The OS calls your AppDelegate’s applicationDidFinishLaunching method.
5. Your code is now in control, starting with whatever is in the applicationDidFinishLaunching method of your AppDelegate.
.
. (User uses the app for a while)
.
6. User taps on the Home button to quit your app.
7. Since your app has no direct way of knowing when the Home button is tapped, the iPhone OS sends an applicationWillTerminate message to your AppDelegate, so you can clean up any open files, etc. before the app quits.There are also other notifications that your AppDelegate can receive between launching and quitting, such as if your app is about to run out of memory.
My Twitts
- RT @RWW: Watch Out Netflix: Amazon to Stream Everything From Spongebob to Jersey Shore http://t.co/AetVrFag 25 mins ago
- RT @Reuters: Greek debt not sustainable with 70 percent haircut: S&P http://t.co/TBEkfhhs 28 mins ago
- Obama trata de enmendar la plana luego de intentar obligar a los católicos a abortar -> http://t.co/FVVl7dgo cc:@marianaatencio 28 mins ago
- Psycho Siri has a grudge http://t.co/e0l5mLYx Awesome video 1 hour ago
- @ceciliamewa mandame tu email por dm 1 hour ago
- RT @Reuters: U.N. rights chief says action on Syria urgent http://t.co/XdmIzLwj 1 hour ago
Blogroll
- Blog de Economía y Finanzas
- Dameon D. Welch-Abernathy – Phoneboy
- Drew’s Marketing Minute
- Duct Tape Marketing
- Geek Dad
- Guy Kawasaki – How to Change the World
- Jeff Pulver Blog
- Kevin Kelly’s LifeStream
- Malcolm Gladwell
- Mark Cuban
- Nerd Vittles
- NovaSphere Blog
- OCS Team Blog
- Robert X. Cringely
- Seth Godin
- Small Business Trends
- The Eco-Capitalist – Tom Szaky
- UC – Joachim Farla
- WorkHappy
Sites I Visit
Spam Blocked






