I want a folder in document directory with constant name. Now i want to save the folder with a variable name, like i have an variable "n" and the value of "n" is changeable now I want to save the folder with the name of "n" value. my code is as follow but it give me error.
NSInteger n = 3;
NSError *error;
NSString *aDocumentsDirectory = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject];
NSString *dataPath = [aDocumentsDirectory stringByAppendingPathComponent:@"%d",n];
[[NSFileManager defaultManager] createDirectoryAtPath:dataPath withIntermediateDirectories:NO attributes:nil error:&error];
NSString *dataPath = [aDocumentsDirectory stringByAppendingPathComponent:[NSString stringWithFormat:@"%d",n];
It may help you.