user635064
user635064

Reputation: 6247

NSArray writeToFile not working first time (but works next time)

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.

Upvotes: 0

Views: 846

Answers (2)

Julio Gorgé
Julio Gorgé

Reputation: 10106

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

Upvotes: 1

Rahul Vyas
Rahul Vyas

Reputation: 28720

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

Upvotes: 1

Related Questions