【发布时间】:2014-06-24 06:22:53
【问题描述】:
我正在使用 XMPP 实现 iPhone 聊天应用程序。我正在尝试使用以下代码获取用户对象:
[[self appDelegate].xmppRoster addDelegate:self delegateQueue:dispatch_get_main_queue()];
[self appDelegate].xmppRoster.autoAcceptKnownPresenceSubscriptionRequests = true;
[self appDelegate].xmppRoster.autoFetchRoster = true;
[[self appDelegate].xmppRoster activate:xmppStream];
[[self appDelegate].xmppRoster fetchRoster];
XMPPUserCoreDataStorageObject *user = [[self appDelegate].xmppRosterStorage userForJID:[XMPPJID jidWithString:@"user@ip" ] xmppStream:[self appDelegate].xmppStream managedObjectContext:[[self appDelegate] managedObjectContext_roster]];
但它返回 null 用户对象。
我在 tableview 控制器中获取用户列表,它工作正常。但在我试图获得特定用户的另一种观点中,它给出了一个问题。
【问题讨论】:
标签: ios chat xmppframework