Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

ahan.tm

macrumors regular
Original poster
Jun 26, 2011
141
0
Florida
Hi,

I am using Robbie Hanson's XMPPFramework in a app. I am trying to download a the XMPP roster from the server, cache it in memory, then display that on a tableview. Right now, the downloading occurs in the App Delegate, then the XMPPRosterMemoryStorage delegate calls my custom delegate, prompting action in a view controller. The issue that I am having is populating an array(s) with user info.

Should I be using
Code:
sortedUsersByName
or
Code:
sortedAvailableUsersByName
?

Or should I use:
Code:
- (void)roster:(XMPPRosterMemoryStorage *)sender didAddUser:(XMPPUserMemoryStorageObject *)user withResource:(XMPPResourceMemoryStorageObject *)resource

- (void)roster:(XMPPRosterMemoryStorage *)sender didUpdateUser:(XMPPUserMemoryStorageObject *)user withResource:(XMPPResourceMemoryStorageObject *)resource

- (void)roster:(XMPPRosterMemoryStorage *)sender didRemoveUser:(XMPPUserMemoryStorageObject *)user withResource:(XMPPResourceMemoryStorageObject *)resource
?

I would like to display the data in a sectioned table view. Currently I populate a single array with dictionaries with a key "online" set to true if the user is online, but I feel that there is a better way. Any ideas?

Thanks!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.