Use of ios-Archives

Source: Internet
Author: User

Archive also called serialization (coding)

Archive Nskeyedarchiver

Solution Archive Nskeyedunarchiver

Files that are archived will be encrypted

Files, data, and any data that can be archived (directly archive an instantiated object, array, dictionary, string, text, picture ...) ).

-----------------------------------------Two methods of solution archiving------------------------------------------

First, we write a method of error prompt:

1. The first method:

Steps to Archive

1. Archived paths require archived data

2. Archive Solution Archive

-----------------------------------------archived------------------------------------------

-----------------------------------------Solution-----------------------------------------

Solution Archive

Steps to extract an archive

1. File path for the archive

2. Solution Archive

Results:

2. The second method:

Second way of archiving (multiple different data simultaneously archived)

This approach is more flexible

Classes for NSData binary data

Steps to archive:

1. Archive file path prepare the archived data

2. Write a mutable nsmutabledata The archived classes let Data prepare to be written to a file

3. Start (archive) coding

4. Complete the archive to write the data to the file

To unpack the archive:

1. File path

2. Read the data inside the file

3. Prepare to archive by extracting data from the archive object

#pragma Mark---------------------------------------------Archive the objects of the custom class--------------------------------------

To archive the objects of the custom class

1. Compliance with archiving Protocol nscoding

2. Implementing the methods in the Archive protocol

3. Encode and decode the properties of a custom class one at a time this object has the ability to archive and archive.

4. Archive Solution Archive

Steps to Archive

1. Prepare the path of the file to be archived data to be archived

2. Archiving

---------------------------------------Solution----------------------------------------

Use of ios-Archives

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.