Uttam Kadam
Uttam Kadam

Reputation: 458

XMPP chat user returning null

I am implementing iPhone chat app using XMPP. I am trying to get user object by using following code:

       [[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]]; 

But it is returning null user object.

I am getting list of users in tableview controller and it is working fine. but in another view where I am trying to get perticular user it is giving an issue.

Upvotes: 1

Views: 261

Answers (1)

Uttam Kadam
Uttam Kadam

Reputation: 458

I found the solution.

I have added following method :

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

And tried to get the user details there and it is working now.

Upvotes: 1

Related Questions