nsdocumentdirectory-ios8

I am unable to save and retrieve image in iOS

拟墨画扇 提交于 2019-12-12 03:38:43
问题 I am unable to save and retrieve image in iOS. I am getting nil image trough this code: -(NSString *)saveImageDataWithImage:(UIImage *)image { NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentationDirectory,NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSString *photoName = [NSString stringWithFormat:@"%ld.png", (long)[[NSDate date] timeIntervalSince1970]]; NSString *getImagePath = [documentsDirectory stringByAppendingPathComponent:photoName];

Convert Ios Photo Album path url same like as Document directory File-path

不羁的心 提交于 2019-12-12 03:24:28
问题 As per my requirement, want to access iOS device photos app file url (not file as data) for my GCDWebUploader. I want assets library url for my web server. NSString* documentsPath =[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) firstObject]; _webServer = [[GCDWebUploader alloc] initWithUploadDirectory: documentsPath]; // this is working and document directory files shown on browser. _webServer = [[GCDWebUploader alloc] initWithUploadDirectory:assetsUrl]; //

iOS8 Document directory path

最后都变了- 提交于 2019-12-08 09:29:07
问题 Issue in iOS8 document directory path detection: Am using following code to store downloaded attachments from my app into documents directory path. //-- Store data to documents folder NSString *resourceDocPath = [[NSString alloc] initWithString:[ [[[NSBundle mainBundle] resourcePath] stringByDeletingLastPathComponent] stringByAppendingPathComponent:@"Documents"]]; NSString *filePath = [resourceDocPath stringByAppendingPathComponent:[NSString stringWithFormat:@"%@",fileName]]; [self

Get image from documents directory swift

冷暖自知 提交于 2019-11-27 00:06:14
Say I were using this code to save an image to the documents directroy let nsDocumentDirectory = NSSearchPathDirectory.DocumentDirectory let nsUserDomainMask = NSSearchPathDomainMask.UserDomainMask if let paths = NSSearchPathForDirectoriesInDomains(nsDocumentDirectory, nsUserDomainMask, true) { if paths.count > 0 { if let dirPath = paths[0] as? String { let readPath = dirPath.stringByAppendingPathComponent("Image.png") let image = UIImage(named: readPath) let writePath = dirPath.stringByAppendingPathComponent("Image2.png") UIImagePNGRepresentation(image).writeToFile(writePath, atomically: true

Get image from documents directory swift

末鹿安然 提交于 2019-11-26 12:21:57
问题 Say I were using this code to save an image to the documents directroy let nsDocumentDirectory = NSSearchPathDirectory.DocumentDirectory let nsUserDomainMask = NSSearchPathDomainMask.UserDomainMask if let paths = NSSearchPathForDirectoriesInDomains(nsDocumentDirectory, nsUserDomainMask, true) { if paths.count > 0 { if let dirPath = paths[0] as? String { let readPath = dirPath.stringByAppendingPathComponent(\"Image.png\") let image = UIImage(named: readPath) let writePath = dirPath