TAILIEUCHUNG - iPhone Cool Projects phần 10

Bạn sẽ nhanh chóng nhận thấy một vấn đề lớn. Chúng tôi không có ý tưởng những gì đích là cho từng đào tạo hiển thị trong các dự đoán. Kể từ khi bảng di động xem mặc định chỉ có một nhãn hiệu duy nhất, chúng tôi không thể hiển thị thông tin nhiều như chúng tôi muốn. Tạo một ô trong bảng xem tùy chỉnh giải quyết vấn đề này. | CHAPTER 7 Going the Routesy Way with Core Location XML andSQLite 187 You ll quickly notice a huge problem. We have no idea what the destination is for each train displayed in the predictions. Since the default table view cell only has a single label we re not able to display as much information as we d like. Creating a custom table view cell solves this problem. 14. Let s create an empty user interface XIB file for our new table view cell. In Xcode select the Resources folder then go to File New and create an empty XIB file called as shown in Figure 7-21. Figure 7-21 Creating a new empty XIB for the custom table view cell 15. You ll also need to create a class to go along with your new table view cell. Since we re customizing the prediction controller cell select the Classes folder go to File New and create a subclass of UITableViewCell called PredictionCell as demonstrated in Figure 7-22. 22 Creating a new UITableViewCell subclass for the custom table view cell 188 CHAPTER 7 Going the Routesy Way with Core Location XML and SQLite 16. Next we ll set up PredictionCell with a two outlets that we ll design in Interface Builder shortly. We ll use one label for the destination name and one label for the estimate of when the train will arrive. Again you ll set up both instance variables as properties prefixed with the IBOutlet qualifier so that you can connect the labels in Interface Builder to the properties in the class. The code for our new class is shown in Listing 7-10. Listing 7-10. Creating the Header for the Custom Prediction Table Cell import UIKit interface PredictionCell UITableViewCell UILabel destinationLabel UILabel estimateLabel property nonatomic retain IBOutlet UILabel destinationLabel property nonatomic retain IBOutlet UILabel estimateLabel end 17. Now let s design our custom table view cell. Save any unsaved files in your project in Xcode and then double-click to open the file in Interface

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.