Swift 4.0 Version guard let image = UIImage(named: "anyImage. NSString *fileName = [stringPath *data = UIImageJPEGRepresentation(imageForShare, 1.0) createDirectoryAtPath:stringPath withIntermediateDirectories:NO attributes:nil error:&error] Here is an example of saving image in documents directory in your own folder. NSString *filename = [docDir stringByAppendingPathComponent:[NSString *error = NULL īOOL written = ![]() ![]() I write this code but my csv file is create in doument diretory folder i want to cretae this file in my folder which is doument directory have with name newFolder NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) createDirectoryAtPath:dataPath withIntermediateDirectories:NO attributes:nil error:&error] Drag down from the center of the screen, tap, then tap New Folder. If playback doesnt begin shortly, try restarting your device. NSString *dataPath = [documentsDirectory *error = NULL How to create folders in iPhone Add folders to iPhone. NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) ![]() This is create folder in my document folder but now i want create file in this folder name newFolder help me in this. I am creating one folder in document directory with name newFolder.So now i want to know how to create txt file in my folder which is create with newFolder i now how to create file in document directory but how to create file in my folder which is create by me.I want to fetch this file also from newFolder and pass to mail composer in iPhone.
0 Comments
Leave a Reply. |