Advertisement
Guest User

Untitled

a guest
Sep 26th, 2017
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. -(void)applicationWillTerminate{
  2.  
  3. NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
  4. NSString *libraryDirectory = [paths objectAtIndex:0];
  5.  
  6.  
  7. NSMutableArray *file = [[NSMutableArray alloc] init];
  8. if ([uploadImages count] > 0) {
  9. for (id obj in uploadImages) {
  10. NSMutableDictionary *dict = [[NSMutableDictionary alloc] init];
  11. NSString *mystring = [[obj valueForProperty:ALAssetPropertyURLs]objectForKey:@"public.jpeg" ];
  12. [dict setObject:mystring forKey:@"img"] ;
  13. if ([dict objectForKey:@"img"] == nil) {
  14. [dict setObject:[[obj valueForProperty:ALAssetPropertyURLs]objectForKey:@"public.jpeg" ] forKey:@"img"] ;
  15. }
  16. [file addObject:dict];
  17. [dict release];
  18. }
  19.  
  20. if ([file writeToFile:[libraryDirectory stringByAppendingPathComponent:@"uploadimages.plist"] atomically:YES])
  21. {
  22. NSLog(@"YES");
  23. }else
  24. {
  25. NSLog(@"files:%@",file);
  26. }
  27. }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement