iPhone SDK 3 Programming Advanced Mobile Development for Apple iPhone and iPod touc phần 7

Phong cách bảng khác có sẵn cho bạn là UITableViewStyleGrouped. Bạn tìm hiểu về các phong cách khác trong mục 9,9. Sau đó, chúng tôi cư theSimpsons mảng với tên sẽ được hiển thị bên trong bảng. Tiếp theo, các nguồn dữ liệu của chế độ xem bảng được thiết lập để thể hiện ủy nhiệm ứng dụng. | Location Awareness 387 Listing shows the implementation of the application delegate class. The application-DidFinishLaunching method simply creates a view controller of type LocationsView-Controller and uses it as the root controller for a navigation controller. The view of the navigation controller is then added as a subview to the main window and the main window is made visible. Listing The implementation of the application delegate class used in the tracking application. import implementation Location3AppDelegate synthesize window - void applicationDidFinishLaunching UIApplication application window UlWindow alloc initWithFrame UIScreen mainScreen bounds ctrl LocationsViewController alloc initWithNibName nil bundle nil navCtrl UINavigationController alloc initWithRootViewController ctrl window addSubview window makeKeyAndVisible - void dealloc ctrl release navCtrl release window release super dealloc end Our view controller is declared in Listing . The view controller adopts the CLLocation-ManagerDelegate as it will be the delegate of the location manager that it will create. It declares two bar buttons for stopping the sampling of movements navigating to the next recording and navigating to the previous recording. The right bar button will be used for both stopping the sampling of movements and as a Next button. In addition the view controller maintains a reference to a web view for visualizing the locations sampled. Listing The declaration of LocationsViewController view controller class used in the tracking application. import UIKit import CoreLocation interface LocationsViewController UIViewController CLLocationManagerDelegate CLLocationManager locationMgr NSUInteger noUpdates NSMutableArray locations UIWebView webView 388 iPhone SDK 3 Programming UIBarButtonItem rightButton leftButton NSUInteger current end Listing shows the implementation of the view controller. In the .

Không thể tạo bản xem trước, hãy bấm tải xuống
TÀI LIỆU MỚI ĐĂNG
Đã 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.