0
我的应用程序解析xml,并从XML中选择的文章内容构建自己的自定义HTML。当我保存一篇文章时,我有一个动作类,其中我将文章标题和自定义HTML传递给Save类中的字符串。该班采取的是并用它保存到应用程序:iOS关联URL和已保存文件
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *pdfPath = [documentsDirectory stringByAppendingPathComponent:[thetitle stringByAppendingString:@".html"]];
NSError *error = nil;
[thehtmlcontents writeToFile:pdfPath atomically:YES encoding:NSUTF8StringEncoding error:&error];
我已经是这个问题,如果我想分享通过Facebook或Twitter保存的文章,我不能,因为URL不与其他一切都得到保存。我可以轻松地将URL传递给Save类,但我不确定如何处理它,以便与文章本身保持关联。建议?