TAILIEUCHUNG - Lập trình iPhone part 10

Ứng dụng các thiết lập mặc định và người sử dụng Tất cả nhưng chương trình máy tính đơn giản nhất ngày nay có một cửa sổ lựa chọn ưu tiên mà người sử dụng một thiết lập các tùy chọn ứng dụng cụ thể. Trên Mac OS X, các mục trình đơn Preferences . là thường tìm thấy trong menu ứng dụng. | Chapt Application Settings and User Defaults II but the simplest computer programs today have a preferences window where the user can set application-specific options. On Mac OS X the Preferences. menu item is usually found in the application menu. Selecting it brings up a window where the user can enter and change various options. The iPhone has a dedicated application called Settings which you no doubt have played with any number of times. In this chapter we ll show you how to add settings for your application to the Settings application and we ll show you how to access those settings from within your application. NQIE Apple s term for Settings and its underlying mechanism is Application Preferences. .10 303 304 CHAPTER 10 Application Settings and User Defaults Getting to Know Your Settings Bundle The Settings application see Figure 10-1 lets the user enter and change preferences for any application that has a settings bundle. A settings bundle is a group of files built into an application that tells the Settings application what preferences the application wishes to collect from the user. Pick up your iPhone or iPod Touch and locate your Settings icon. You ll find it on the home screen. When you touch the icon the Settings application will launch. Ours is shown in Figure 10-2. The Settings application acts as a common user interface for the iPhone s User Defaults mechanism. User Defaults is the part of Application Preferences that stores and retrieves preferences. User Defaults is implemented by the NSUserDefaults class. If you ve done Cocoa programming on the Mac you re probably already familiar with NSUserDefaults because it is the same class that is used to store and read preferences on the Mac. Your applications will use NSUserDefaults to read and store preference data using a key value just as you would access keyed data from an difference is that NSUserDefaults data is persisted to the file system .

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.