Colloquy, the open source iPhone App
The good news is Colloquy iPhone app is also open source. Is it great? It is so comprehensive and complete program with many cool hack features. If you want to start your own app, which needs supports chat function. Colloquy is the one you must check it out first.
If you find this help you for getting your app out of door, please do not forget to join in the Colloquy development community to make it better.