TAILIEUCHUNG - Phát triển ứng dụng cho iPhone và iPad - part 18

Tham khảo tài liệu 'phát triển ứng dụng cho iphone và ipad - part 18', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | Using Core Data A Simple Task Manager 139 Next you need to build a new screen for entering the Task text. In a production application you would probably want to use Interface Builder to build a nice user interface for this screen. However to keep this example simple you will just build a very simple interface in code. Add a new UlViewController subclass to your project. Make sure you clear the checkboxes for UITableViewController subclass and With XIB for user interface. Call your new class TaskEntryViewController. Modify the header to include instance variables for a UITextField and the Managed Object Context. When the RootViewController calls up the TaskEntryViewController it will set the reference to the context. Declare the properties for the UITextField and the managed object context. Finally modify the interface definition to indicate that you will be implementing the UITextFieldDelegate protocol. You use this protocol to receive messages from the UITextField. Specifically you will be implementing the textFieldShouldReturn method that runs when the Return button is pressed in a TextField. The code for the header should look like this import UIKit Available lor download on interface TaskEntryViewController UlViewController UITextFieldDelegate UITextField tf NSManagedObjectContext managedObjectContext property retain nonatomic UITextField tf property retain nonatomic NSManagedObjectContext managedObjectContext end Now you will implement the TaskEntryViewController. First synthesize the TextField and the context properties synthesize tf managedObjectContext Next you need to add code to to programmatically create the UI in the loadView method Available for download on void loadView super loadView UITextField alloc initWithFrame CGRectMake 65 20 200 20 setBackgroundColor UIColor lightGrayColor setDelegate self .

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.