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

Tham khảo tài liệu 'phát triển ứng dụng cho iphone và ipad - part 30', 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ả | Core Data Performance 259 Core Data does not bring relationships to a faulted object into memory until you access them. This behavior allows Core Data to conserve memory by keeping unused objects out of memory until you need them. In this example Core Data is preventing only one object the Location from being loaded. You may be thinking that this doesn t save too much memory. That is true but imagine if the location object were also related to a series of other objects each with its own relations and so on. In large object hierarchies the memory conserved by faulting can be considerable. Data Store Types When using Core Data you can specify the type of data store that Core Data uses to persist your data. Your options are SQLite binary and in-memory. Although you will usually use the SQLite store type you will take a brief look at all of the types. The in-memory store does not actually persist your data at all. As the name says the data store is in memory. When your application quits your data is gone. This could be useful in situations where you want to use Core Data to manage your application data when that data does not need to be persisted from session to session. This is typically not very useful in iOS applications as your application session could end at any time particularly if the user of an iPhone gets a call. The binary store type uses a proprietary binary format to store your data. The primary drawback of using the binary format is that all of the data stored in the data store is loaded into memory when the data store is loaded. There is no provision to leave parts of the data on disk. In contrast an SQLite database remains largely left on disk and Core Data only brings the parts that you specifically query for into memory. Although there is no disk on the iPhone or iPad there is a difference between application memory and storage memory. When I say on disk I am referring to the space on the device that is used for data storage. The iPhone or iPad cannot

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
139    94    3    03-06-2024
Đã 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.