iPhone - Writing a dictionary to file : handling errors
问题 When saving a NSDictionary to file using : - (BOOL)writeToFile:(NSString *)path atomically:(BOOL)flag YES or NO can be returned. There are some methods for writing files that accept a NSError parameter. In the case of the NSDictionary, such a method doesn't exist. So if the writeToFile method returns NO, how may I know what happened ? 回答1: Look at the docs for writeToFile:atomically: to see which data types can be in a dictionary when you use this method. If you include an object not among