tailieunhanh - Thủ thuật lập trình cho iPhone part 9

Đây là phần cuối cùng của loạt 4 phần của chúng tôi tạo ra một danh sách Todo cho iPhone. Trong hướng dẫn này, tôi sẽ chi tiết làm thế nào để thêm và xóa các đối tượng Todo mới từ cơ sở dữ liệu SQLite. | Bài 10 Creating a ToDo List Using SQLite Part 4 This is the final installment of our 4 part series of creating a Todo list for the iPhone. In this tutorial I will detail how to add and delete new todo objects from the SQLite database. Make sure that you have completed the following tutorials before you begin this one . iPhone Programming Tutorial - Creating a ToDo List Using SQLite Part 1 . iPhone Programming Tutorial - Creating a ToDo List Using SQLite Part 2 . iPhone Programming Tutorial - Creating a ToDo List Using SQLite Part 3 When you have completed this tutorial you should have a main screen that looks something like this Collection By traibingo Let s get started. The first thing we need to do is add the UlBarButtonItem items to the NavigationBar so that we get the Edit and Add button. Open up Collection By traibingo and add the following code to the viewDidLoad method. - void viewDidLoad @ Todo Items leftBarButtonltem UIBarButtonltem btn iJIBarButtonltem alloc initWtthTitle @ Add sty le UIEarEuttonltemSty leEordered target se I f act i on SseI ector add odo btn The first thing we see is the line that sets the leftBarButtonItem to . This automatically adds the Edit button to the NavigationController. Also it sets up the functionality that allows the delete buttons to be displayed when the button is pressed. You can see this functionality if you do a Build and Go at this step. Next I have manually created a UIBarButtonItem and added it to the navigationbar. This can be done in Interface Builder but I wanted to show you how to do it manually and assign an action to it I m sure you will require this functionality in a future program . Here is a break down of the parameters initWithTitle - The text to be displayed on the button style - How the button will look target - The class object that handles the messages sent from this button .

crossorigin="anonymous">
Đã 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.