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類,但我不確定如何處理它,以便與文章本身保持關聯。建議?