Reputation: 3455
I am working on chatting app in iOS using xmpp and ejabberd . I am not able to remove single message.
Is this correct method - (void)removeResources:(NSSet *)value
to remove chat? And what parameter I need to remove chat?
Or do I need to remove entry from core data? On Quick Blox I found this method:
NSSet *mesagesIDs = [NSSet setWithObjects:@"54fdbb69535c12c2e407c672", @"54fdbb69535c12c2e407c673", nil];
[QBRequest deleteMessagesWithIDs:mesagesIDs
How to use this in my project without quickblox?
Upvotes: 2
Views: 844
Reputation: 3733
If you have XMPPMessageArchiving_Message_CoreDataObject
. i think this object is used to display data in UITableView
so you can direct removed that object from core data using below code. Here i am showing to delete loop of messages.
NSManagedObjectContext *moc = [self managedObjectContext];
for (XMPPMessageArchiving_Message_CoreDataObject *message in messages)
{
[moc deleteObject:message];
}
Hope this help you.
Upvotes: 1