0

I referred following links but its not working in iOS 8.3 iPod

Write contents of array to a text file

is it possible to save NSMutableArray or NSDictionary data as file in iOS?

NSString *file_path = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) firstObject] stringByAppendingPathComponent:@"/app_name/untitled.txt"];
[myArr writeToFile:file_path atomically:YES];

I am trying to write NSMutableArray in text file. This code is not working for iOS 8.3, where NSMutableArray has NSMutableDictionary contents.

Community
  • 1
  • 1
user3898700
  • 141
  • 1
  • 12
  • 'Not working' in what sense? What output do you get? – Tommy Jun 25 '15 at 11:59
  • @Tommy file is not created in application's local folder. Instead of NSMutableArray, if i use NSString like [string writeToFile:file_path atomically:YES encoding:NSUTF8StringEncoding error:nil]; file is created. – user3898700 Jun 25 '15 at 12:24
  • So what is `file_path` set to? – Droppy Jun 25 '15 at 12:25

0 Answers0