ios - save folder with integer variable name in document directory -


i want folder in document directory constant name. want save folder variable name, have variable "n" , value of "n" changeable want save folder name of "n" value. code follow 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 you.


Comments

Popular posts from this blog

How to mention the localhost in android -

php - Calling a template part from a post -

c# - String.format() DateTime With Arabic culture -