Archive and archive

Source: Internet
Author: User

Archive and archive
1. Archiving

NSArray * array = @ [@ "ARCHIVE", @ "", @ ""];

// 1. Create an archive object

NSMutableData * data = [NSMutableDatadata];

NSKeyedArchiver * archiver = [[NSKeyedArchiveralloc] initForWritingWithMutableData: data];

// 2. Archive

[Archiver encodeObject: primary key: @ "array"];

// 3. the archive is terminated. If the archive is terminated, the archive is invalid.

[Archiver finishEncoding];

[Array release];

[Archiver release];


// 4. Obtain the path of the written file. No file is automatically created.
NSString * documentPath =
[NSSearchPathForDirectoriesInDomains (NSDocumentDirectory, NSUserDomainMask, YES) firstObject];
NSString * newFiel = [documentPathstringByAppendingPathComponent: @ "bb.txt"];

// 5. Write data to the file

BOOL isSucceed = [datawriteToFile: [selfgetFiel] atomically: YES];


Ii. Archive operations

// 1. initialize NSMutableData Based on the file path

NSMutableData * Data = [NSMutableDatadataWithContentsOfFile:/Users/lanouhn/Library/Application Support/iPhone Simulator/7.1/Applications/300BEFD5-1F93-47A3-A1B3-936195FAA53F];

// 2. Create an archive class

NSKeyedUnarchiver * unarchiver = [[NSKeyedUnarchiveralloc] initForReadingWithData: Data];

// 3. Archive

NSArray * array = [unarchiverdecodeObjectForKey: @ "array"];


// 4. End the archive

[Unarchiver finishDecoding];

[Unarchiver release];


3. Note

1. If you want to archive a class object, you must enable the class to implement the NSCoding protocol.

2. When the object is a string, array, Dictionary, or set, the semantic attribute of the attribute is declared as copy.

3. When assigning values to instance variables after defining attributes, use the setter method.

Example
@ Interface Person: NSObject <NSCoding]>
@ Property (nonatomic, copy) NSString * name

What transaction Code does SAP archive use to reverse query archiving objects from tables?

DB15 is under investigation. You can perform reverse lookup. However, not all tables in SAP can be archived and archive objects can be found.

What is archive

Archiving: a synonym for archiving refers to the process of handing over the processed and stored things or files to the archive room for Record Filing (for future reference) after being organized by the system. Archiving refers to the process in which the document Department organizes and submits the documents that have been completed and saved to the archive room or archive through the system. Archiving is a system stipulated by the state, also known as "archiving system ". [Archiving time]: 1) Regular archiving is required. Regular archiving means that the documents and materials processed are organized and archived by the document department or business department and handed over to the archive room on a regular basis. 2) the handover generally takes place in the first half of the second year. Some specialized documents or documents of scattered individual business units in the third year can be postponed to the second half of the second year. [Archive Scope]: All documents and materials that reflect the work activities of the Agency and have the value of checking and using are archived. [Archive file quality requirements]: (I) archive the original file; (2) Complete and complete file materials to be archived; (3) contact the document and telegram according to its content, (4) maintain historical connections between archived files, differentiate stored values, classify files, and create files. The title of the file is concise and accurate, easy to store and use.
Reference: Baidu encyclopedia

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.