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