Oolite 1.91.0.7646-241128-10e222e
Loading...
Searching...
No Matches
NSDictionary(OOXMLExtensions) Category Reference

#include <OOXMLExtensions.h>

Instance Methods

(BOOL) - writeOOXMLToFile:atomically:errorDescription:
 

Detailed Description

Definition at line 37 of file OOXMLExtensions.h.

Method Documentation

◆ writeOOXMLToFile:atomically:errorDescription:

- (BOOL) writeOOXMLToFile: (NSString *) path
atomically: (BOOL) flag
errorDescription: (NSString **) outErrorDesc 

Definition at line 1 of file OOXMLExtensions.m.

30 :(NSString *)path atomically:(BOOL)flag errorDescription:(NSString **)outErrorDesc
31{
32 NSData *data = nil;
33 NSString *errorDesc = nil;
34
35 data = [NSPropertyListSerialization dataFromPropertyList:self format:NSPropertyListXMLFormat_v1_0 errorDescription:outErrorDesc];
36 if (data == nil)
37 {
38 if (outErrorDesc != NULL)
39 {
40 *outErrorDesc = [NSString stringWithFormat:@"could not convert property list to XML: %@", errorDesc];
41 }
42#if OOLITE_RELEASE_PLIST_ERROR_STRINGS
43 [errorDesc release];
44#endif
45 return NO;
46 }
47
48 if (![data writeToFile:path atomically:YES])
49 {
50 if (outErrorDesc != NULL)
51 {
52 *outErrorDesc = [NSString stringWithFormat:@"could not write data to %@.", path];
53 }
54 return NO;
55 }
56
57 return YES;
58}
return nil

References nil.


The documentation for this category was generated from the following files: