HI,
From a table, once i selected the row, i would the row name to be store in a text file. how do i do that?
HI,
From a table, once i selected the row, i would the row name to be store in a text file. how do i do that?
Something like this if you wanted to write it to the cache directoy and your using an array to store the information displayed in your table.
-void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
NSString *SelectedRow =
[array objectAtIndex:indexPath.row];
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
NSString *cachePath = [paths objectAtIndex:0];
NSString *fileName = [NSString stringWithFormat:@"%@/textfile.txt", cachePath];
[SelectedRow writeToFile:fileName atomically:YES encoding:NSStringEncodingConversionAllowLossy
error:nil];
}