Skip to Content
Beginning iOS 4 Application Development
book

Beginning iOS 4 Application Development

by Wei-Meng Lee
October 2010
Beginner
655 pages
14h 9m
English
Wrox
Content preview from Beginning iOS 4 Application Development

Chapter 21. Background Applications

WHAT YOU WILL LEARN IN THIS CHAPTER

  • How background code execution works in your iPhone applications

  • Monitoring application states

  • How to detect and opt out of background execution

  • How to track location information in the background

  • Creating local notifications

One of the main features of iOS 4 is its support for background applications. Unlike the previous versions of the iPhone OS, iOS 4 does not automatically terminate your application when you press the Home button on your device. Instead, your application is put into a suspended state and all processing is paused. When you tap on the application icon again, the application resumes from its suspended state and continues execution. If your application should continue executing in the background, you need to modify it to inform the OS.

In this chapter, you will examine how background execution works and some of the limitations placed on your applications. In particular, you will learn how to modify the location application covered in Chapter 20 so that it will continue working even after the user has switched it to the background. Last but not least, you will learn about the local notification feature that is new in iOS 4.

Understanding Background Execution on the iPhone

While iOS 4 supports background code execution, there are several things that you need to understand before you write your application:

  • In order to support background code execution, all applications must be compiled against the iPhone ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Beginning iOS 5 Application Development

Beginning iOS 5 Application Development

Wei-Meng Lee
More iPhone Development with Objective-C

More iPhone Development with Objective-C

David Mark, Jayant Varma, Jeff LaMarche, Alex Horovitz, Kevin Kim

Publisher Resources

ISBN: 9780470918029Purchase book