i want to save an image with new name every time in xcode using objective c. how to do that? i want to add a time string in the name, and i have stored time string in a variable. how to concatenate that variable with the name. code which i am using is as---
NSDate *currDate = [NSDate date];
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc]init];
[dateFormatter setDateFormat:@"dd.MM.YY HH:mm:ss"];
NSString *dateString = [dateFormatter stringFromDate:currDate];
NSLog(@"%@",dateString);`
NSData *myImageData = UIImageJPEGRepresentation(image, 1.0);
[fileManager createFileAtPath:@"/Users/name/Desktop/myimage.jpg" contents:myImageData attributes:nil];