tailieunhanh - Lập trình ứng dụng cho iPhone part 13
Creating basic view controllers Trong hai chương cuối cùng, chúng tôi đã cung cấp phương pháp nhìn vào lúc các công cụ cốt lõi hai được sử dụng để chương trình bằng cách sử dụng SDK: Xcode và Giao diện Builder. Trong quá trình này, chúng tôi đã không đi lạc xa các khối xây dựng cơ bản nhất của SDK, quan điểm, cho dù đó là một UILabel, một UIWebView, hoặc một UIImageView. Cuối cùng, xem chỉ là một phần của câu chuyện. Như chúng ta đã đề cập khi chúng ta nhìn vào hệ điều hành iPhone, quan điểm. | Creating basic view controllers This chapter covers Understanding the importance of controllers Programming bare view controllers Utilizing table view controllers In the last two chapters we ve offered a hands-on look at the two core tools used to program using the SDK Xcode and Interface Builder. In the process we haven t strayed far from the most fundamental building block of the SDK the view whether it be a UILabel a UlWebView or a UllmageView. Ultimately the view is only part of the story. As we mentioned when we looked at the iPhone OS views are usually connected to view controllers which manage events and otherwise take the controller role in the MVC model. We re now ready to begin a three-part exploration of what that all means. In this chapter we re going to look at basic view controllers that manage a single page of text. With that basis we can look at events and actions in chapter 14 correctly integrating them into the MVC model. Finally in chapter 15 we re going 221 222 Chapter 13 Creating basic view controllers to return to the topic of view controllers to look at advanced classes that can be used to connect up several pages of text. Over the course of our two view controller chapters 13 and 15 we re going to offer code samples that are a bit more skeletal than usual. That s because we want to provide you with the fundamental reusable code that you ll need to use the controllers on your own. So consider chapters 13 and 15 more of a reference though a critical one. We ll be making real-world use of the controllers in the rest of this book including when we look at events and actions in chapter 14. The view controller family When we first talked about view controllers in chapter 10 we mentioned that they come in several flavors. These run from the bare bones UlViewController which is primarily useful for managing autorotation and for taking the appropriate role in the MVC model to the more organized UITableViewController on to a few different .
đang nạp các trang xem trước