O'Reilly logo

iPhone® Application Development For Dummies®, 2nd Edition by Neal Goldstein

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 9. Saving Data and Creating a Secret Button

In This Chapter

  • Setting and accessing user preferences

  • Saving data in user preferences

  • Disabling and enabling text fields

  • Responding to user touches

In putting together a great iPhone application, a big part of the whole process involves getting your application to work well from the user interface perspective. Your potential user should be able to scroll the keyboard, work with text fields, enter stuff, delete stuff, admire your fashion sense when it comes to images and background color, and generally have a grand-old time exploring the corners of your app.

Interfaces are important — so important, in fact, that most of the chapters so far in this part deal explicitly with how to set up a user-friendly interface — but interfaces are not the only things in the iPhone app universe. For your application to function as an application, it has to do application-like stuff. For example, it has to be able to save data entered by a user for the next time he or she fires up that app. In this chapter, I tackle how to get your app to save data entered by the user. Again, I'm going to trot out my ReturnMeTo application as a means of imparting this little lesson in data saving.

Wait! That's not all! It occurred to me while I was showing people my handy ReturnMeTo application that whoever found my iPhone could accidently enter a number in the text field — corrupting the crime scene, as it were — and then wouldn't know where to call me. So I decided ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required