Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/94.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios XMPP聊天用户返回null_Ios_Chat_Xmppframework - Fatal编程技术网

Ios XMPP聊天用户返回null

Ios XMPP聊天用户返回null,ios,chat,xmppframework,Ios,Chat,Xmppframework,我正在使用XMPP实现iPhone聊天应用程序。我正在尝试使用以下代码获取用户对象: [[self appDelegate].xmppRoster addDelegate:self delegateQueue:dispatch_get_main_queue()]; [self appDelegate].xmppRoster.autoAcceptKnownPresenceSubscriptionRequests = true; [self appDeleg

我正在使用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]]; 
但它正在返回空用户对象

我正在获取tableview控制器中的用户列表,它工作正常。但在另一个视图中,我试图获得特定的用户,这是一个问题。

我找到了解决方案

我增加了以下方法:

- (void)controllerDidChangeContent:(NSFetchedResultsController *)controller{
} 

并尝试在那里获取用户详细信息,现在正在运行。

我需要在哪里添加此方法?请将其添加到viewController中。请通过此函数调用“获取用户数据”函数。如果您没有获得所需的数据,请共享您的代码。