0

I am writing a huge NSArray of NSDictionaries. The file size when successfully written to a plist is about 549KB. The thing is, when I start my app, the first time I try to write it, it always returns NO (i.e. it didn't write), but then the next time it write just fine...Is there any way I can find out exactly what error occurred? Thanks.

user635064
  • 6,219
  • 12
  • 54
  • 100

2 Answers2

1

Might be your array of dictionaries is empty? Try to debug your app.

Rahul Vyas
  • 28,260
  • 49
  • 182
  • 256
1

Use NSData - writeToFile:options:error: instead and see what does the returned error (NSError) say.

Julio Gorgé
  • 10,056
  • 2
  • 45
  • 60
  • 2
    @user635064 See [`this`](http://stackoverflow.com/questions/1286212/how-to-convert-nsarray-to-nsdata) for converting an `NSArray` to `NSData`. – Deepak Danduprolu Jun 11 '11 at 06:47