NSFileManager has a copy method.
- (BOOL)copyItemAtPath:(NSString *)srcPath toPath:(NSString *)dstPath error:(NSError **)error
If an error occurs, the third parameter (NSError **) upon return will contain an NSError object describing the problem.
Question: Do I need to let him go?
There are other methods, for example, this requires (NSString **) ,
NSPropertyListSerialization +(NSData *)dataFromPropertyList:(id)plist format:(NSPropertyListFormat)format errorDescription:(NSString **)errorString
Do they follow the same rules of memory management? Release or not, that is the question.
--- Answer
As Anders said, the answer "no" should be issued.
I am confused because the NSPropertyListSerialization class has a method
+ (NSData *)dataFromPropertyList:(id)plist format:(NSPropertyListFormat)format errorDescription:(NSString **)errorString
The document says that I should issue the third argument, if not nil. However, it is deprecated and replaced by
+ (NSData *)dataWithPropertyList:(id)plist format:(NSPropertyListFormat)format options:(NSPropertyListWriteOptions)opt error:(NSError **)error
(NSError **). , . .
---
Apple , , :
, NSError, .