gpt4 book ai didi

ios - 如何将消息导出到文本文件。仅限选定的用户

转载 作者:行者123 更新时间:2023-11-30 13:13:02 28 4
gpt4 key购买 nike

这是我收到所有消息但我只想将选定的消息放入文本文件的代码..

-(void)testMessageArchiving
{
XMPPMessageArchivingCoreDataStorage *storage = [XMPPMessageArchivingCoreDataStorage sharedInstance];
NSManagedObjectContext *moc = [storage mainThreadManagedObjectContext];
NSEntityDescription *entityDescription = [NSEntityDescription entityForName:@"XMPPMessageArchiving_Message_CoreDataObject"
inManagedObjectContext:moc];
NSFetchRequest *request = [[NSFetchRequest alloc]init];
[request setEntity:entityDescription];
NSError *error;
NSArray *messages = [moc executeFetchRequest:request error:&error];

[self print:[[NSMutableArray alloc]initWithArray:messages]];
}

最佳答案

在不了解 CoreData 架构的情况下很难回答您的问题,但总的来说:您正在请求所有消息。您应该创建一个仅返回您想要打印的消息的 NSFetchRequest。

关于ios - 如何将消息导出到文本文件。仅限选定的用户,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38530099/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com