[iPhone高级] 基于XMPP的IOS聊天客户端程序(IOS端三)
前两篇介绍了如何通过XMPP来发送消息和接收消息,这一篇我们主要介绍如何来美化我们的聊天程序,看一下最终效果呢,当然源程序也会在最后放出
好了,我们来看一下我们写的程序
这里我们自定义了TableViewCell
一行是显示发布日期,一行是显示发送的消息,还有一个是背景
- (IBAction)sendButton:(id)sender { //本地输入框中的信息 ...... if (message.length > 0) { ..... NSMutableDictionary *dictionary = [NSMutableDictionary dictionary]; [dictionary setObject:message forKey:@"msg"]; [dictionary setObject:@"you" forKey:@"sender"]; [dictionary setObject:[Statics getCurrentTime] forKey:@"time"]; [messages addObject:dictionary]; //重新刷新tableView [self.tView reloadData]; } }好了,这里关于XMPP发送消息的教程就结束了,以后我们会详细介绍其他关于XMPP的内容
源码下载