@Mike가 제안한 바에 따르면 키 체인을 사용하여 암호를 저장해야합니다 .Google은 온라인에서 사용할 수있는 자습서를 제공합니다.
xml 저장에 관해서는. 다음은 코드입니다
NSData *serializedData;
NSString *error;
serializedData = [NSPropertyListSerialization dataFromPropertyList:YourArray(You can use dictionaries.strings..and others too)
format:NSPropertyListXMLFormat_v1_0 errorDescription:&error];
if (serializedData) {
// Serialization was successful, write the data to the file system // Get an array of paths.
NSArray *documentDirectoryPath = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *docDir = [NSString stringWithFormat:@”%@/serialized.xml”,
[documentDirectoryPath objectAtIndex:0]];
[serializedData writeToFile:docDir atomically:YES];
}
else {
// An error has occurred, log it
NSLog(@”Error: %@”,error); }
}
비밀번호와 같은 '비밀'을 저장하는 경우 키 체인을 사용해야합니다. –
어떻게 할 수 있습니까? – Ali