Chapter 8. Entering and Managing Data

In This Chapter

  • Going with the flow in an iPhone application

  • Working with notifications

  • Using dictionaries

  • Understanding view geometry

  • Scrolling views

  • Dismissing the keyboard

  • Becoming a delegate

  • Adopting protocols

  • Navigating your code

Things aren't perfect with our ReturnMeTo application yet. The iPhone on the left in Figure 8-1 shows what happens when you select the text field to enter a phone number.

Not very useful, is it? Reminds me of the time I sat behind Yao Ming in the movie theater. (Can you say, "Down in front!"?)

The iPhone on the right in Figure 8-1 does it the way it should be — as in, the keyboard ducks down so you can see what you're typing.

Okay, maybe the movie-theater metaphor isn't that appropriate (I was kidding about famous basketball players anyway). It's not that the keyboard ducks down so you can better see the content view; rather, the idea is to scroll the content view up when the keyboard appears so you can see the phone number you're entering as you continue to develop the application.

Incidentally, implementing this little scrolling business is probably the most complicated thing you'll be doing with this application. It involves a number of different objects and methods that are called over the life of the application.

Well, you do get a keyboard, but not much else.

Figure 8.1. Well, you do get a keyboard, but not much else.

I have an ulterior motive here: As I take you through ...

Get iPhone™ Application Development for Dummies® now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.