我这样尝试:

XMPPRosterMemoryStorage *xmppRosterMemStorage = [[XMPPRosterMemoryStorage alloc] init];
XMPPRoster *xmppRoster = [[XMPPRoster alloc] initWithRosterStorage:xmppRosterMemStorage
                                         dispatchQueue:dispatch_get_main_queue()];
[xmppRoster addDelegate:self delegateQueue:dispatch_get_main_queue()];
xmppRoster.autoAcceptKnownPresenceSubscriptionRequests = true;
xmppRoster.autoFetchRoster = true;
[xmppRoster activate:xmppStream];
[xmppRoster fetchRoster];


但是xmppRoster为空。为什么?

最佳答案

名册项目存储在[xmppRosterMemStorage mainThreadManagedObjectContext]中,您可以将其与NSFetchedResultsController用作UITableView的数据源,请参阅XMPPFramework源中的iPhoneXMPP示例

10-08 12:20