0

i have a module to create a csv files and fill some data into that there is no error while am writing it on csv. But still i want to create more csv files and access it from my iphone App

Requirements:

1) i want what are the csv files which i have created should be visible on Iphone App i.e if i click downloads button in my App i have to list out all the csv files should be listed in table view

2) if i selected any of the csv files its should open in screen

here my sample code:

NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *filePath = [NSString stringWithFormat:@"%@/%@", documentsDirectory, @"EmployeeRecords.csv"];
NSLog(@"filePath-->%@",filePath);
[csvString writeToFile:filePath atomically:YES encoding:NSUTF8StringEncoding error:nil];

note: before making it as duplicate explain the answer then make it as duplicate that answer is not suitable for my question

batMan007
  • 551
  • 1
  • 10
  • 24
  • Possible duplicate of [How do I enumerate through a directory in Objective-C, and essentially clear out all the directories of non-directory files?](https://stackoverflow.com/questions/17635586/how-do-i-enumerate-through-a-directory-in-objective-c-and-essentially-clear-out) – Larme Nov 27 '17 at 12:07
  • can u give proper explanation it showing to remove dir but what i expecting all my documents should saved and listed in app – batMan007 Nov 27 '17 at 12:20
  • Instead of `[fm removeItemAtURL:url error:NULL];`, just add the extension at an array? – Larme Nov 27 '17 at 12:26
  • sorry bro i cant get u – batMan007 Nov 27 '17 at 12:26
  • https://stackoverflow.com/questions/8376511/list-saved-files-in-ios-documents-directory-in-a-uitableview ? – Larme Nov 27 '17 at 12:28
  • thanx bro it displayed the title ... if i click any one of the file the data will be exported through via mail ? – batMan007 Nov 27 '17 at 12:35
  • You want to send the csv through mail? That's another question and it has already been asked many times on SO and has many responses. Did you look for it? – Larme Nov 27 '17 at 12:39

0 Answers0