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

Tham khảo tài liệu 'phát triển ứng dụng cho iphone và ipad - part 21', 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ả | RootViewController and the Basic UI 169 The RootViewController header file should look like Listing 7-1. LISTING 7-1 Available for download on interface RootViewController UIViewController NSFetchedResultsControllerDelegate NSFetchedResultsController fetchedResultsController NSManagedObjectContext managedObjectContext UITableView taskTableView - IBAction toolbarSortOrderChanged id sender - IBAction toolbarFilterHiPri id sender - IBAction toolbarFilterAll id sender - IBAction locationButtonPressed id sender property nonatomic retain NSFetchedResultsController fetchedResultsController property nonatomic retain NSManagedObjectContext managedObjectContext property nonatomic retain IBOutlet UITableView taskTableView end Now that the interface and header are ready you need to get in and modify the implementation file. First you ll need to synthesize the new taskTableView property. You can just add the taskTableView to the existing synthesize statement synthesize fetchedResultsController managedObjectContext taskTableView In the controllerDidChangeContent method change the reference from to . If you recall this class used to inherit from UITableViewController. In UITableViewController there is a property called tableview. Because you are no longer inheriting from UITableViewController you had to create your own taskTableView property. You are changing the code to reflect this change. The controllerDidChangeContent method should now look like this - void controllerDidChangeContent NSFetchedResultsController controller reloadData Next although you are not ready to implement the full functionality you should add stub implementations of the action methods that you declared in the header file. The stubs use the NSLog function to log a message when the user presses a button. This is helpful in debugging issues with Interface Builder because it proves that you have linked the .

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.