Is your app going to create new users, and add them in the chat list, or going to use existing users (like Gtalk, Y! Messenger etc) on existing protocols (like IRC, XMPP etc)...?
If you are going to implement your own chat system, where your users are registering in your website, then you are going to do these things:
- Setup your website
- Create a protocol (that's, how you pass messages)
- Write and implement an API (in PHP, ASP etc)
- Connect that API with your iPhone app.
How it works?
You keep a table of chat messages. The table include:
- Chat_From
- Chat_To
- Chat_Message
- Timestamp
All what you do is, when you start a Chat session from Alice to Bob, you just enter them in the table. Next, you fetch the row from the Web Server to your App, by calling your PHP file (say, http://mychatserver.com/getChat.php) based on the condition SELECT CHAT_MESSAGE FROM CHAT_TABLE WHERE CHAT_FROM="ALICE" AND CHAT_TO="BOB";
. This message is displayed in your App.
This process should be performed repeatedly, with an interval of, say 1 sec.
I hope you got this idea.