iphone - How do I find out why file I/O operations fail? -
In many ways I used to write files, returning a BOOL indicating their success, e.g.
- (BOOL) writeToFile: (NSString *) path atom: (BOOL) flag
NSKeyedArchiver: />
- (BOOL) Archive RootObject: (id) rootObject toFile: (NSString *) path
Anyhow, this is one of my tester tools Did not come back on It is very good (well, not really), but anyway to know that why these actions can fail?
The modern way (the original object | dictionary) to create NSDT, then to that data writeToFile: options: error:
or writeToURL: option: error:
. In relation to these methods an NSError object returns, in which the user has an error message (in some cases at least), in which something happened.
To create data that represents a dictionary, NSPropertyListSerialization
(if the dictionaries and all the content, all the way down, one is valid) or the collector (if not).
Comments
Post a Comment