-(NSString *)getRecordFilePath{
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *path = [documentsDirectory stringByAppendingPathComponent:@"test.plist"];
return path;
}
-(NSMutableArray *)readLevelData{
NSString * filePath=[self getRecordFilePath];
// NSLog(@"this is filePath : %@",filePath);
self.myInfo_array=[NSKeyedUnarchiver unarchiveObjectWithFile:filePath];
if (!myInfo_array) {
[self setDate];
}
return myInfo_array;
}
-(void)saveLevelData {
NSString *path = [self getRecordFilePath];
BOOL boo=[NSKeyedArchiver archiveRootObject:self.myInfo_array toFile:path];
NSLog(@"储存 bool : %d",boo);
}