增加读取 AccountInfo 时的判断,优化方法效率
This commit is contained in:
@@ -52,7 +52,15 @@ static AccountInfoStorage *_instance = nil;
|
||||
if (self.accountModel != nil) {
|
||||
return self.accountModel;
|
||||
}
|
||||
|
||||
if ([[NSFileManager defaultManager] fileExistsAtPath:[self getFilePath]] == NO) {
|
||||
return nil;
|
||||
}
|
||||
|
||||
NSData *data = [[NSData alloc] initWithContentsOfFile:[self getFilePath]];
|
||||
if (data == nil) {
|
||||
return nil;
|
||||
}
|
||||
|
||||
NSKeyedUnarchiver *unarchiver = [[NSKeyedUnarchiver alloc] initForReadingWithData:data];
|
||||
//解档出数据模型
|
||||
|
Reference in New Issue
Block a user