Guest User

Untitled

a guest
Jul 21st, 2018
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. NSFileManager *fileManager = [NSFileManager defaultManager];
  2.  
  3. if([fileManager fileExistsAtPath:dataFilePath]) {
  4. // Load the array
  5. NSMutableArray *arrayFromDisk = [NSKeyedUnarchiver
  6. unarchiveObjectWithFile:dataFilePath];
  7.  
  8. [Data sharedData].listOfItems = arrayFromDisk;
  9.  
  10. NSLog(@"Loaded");
  11. }
  12.  
  13. @try {
  14. // Load the array
  15. NSMutableArray *arrayFromDisk = [NSKeyedUnarchiver
  16. unarchiveObjectWithFile:dataFilePath];
  17.  
  18. [Data sharedData].listOfItems = arrayFromDisk;
  19.  
  20. NSLog(@"Loaded");
  21. }
  22.  
  23. @catch (NSException* e) {
  24. NSLog(@"Caught exception: %@", e);
  25. }
Add Comment
Please, Sign In to add comment