You need to package the string value in NSData then you can write it to disk. You can do it using the contentsForType:error method.
Below is a sample code, first check that the string is not NULL :
- (id)contentsForType:(NSString *)typeName error:(NSError **) myError{
if (!self.stringDocument)
self.stringDocument = @"";
NSData *nsDataDocument = [self.stringDocument
dataUsingEncoding:NSUTF8StringEncoding];
return nsDataDocument;
}
written by: infinitywebseo
No comments:
Post a Comment