Xcode 聊天应用,创建动态视图——有点迷失 [英] Xcode chat app, creating dynamic views - a little lost

查看:53
本文介绍了Xcode 聊天应用,创建动态视图——有点迷失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我即将开始做一个 iphone 应用程序,它应该有一个多用户私人聊天.类似于 facebook 风格,用户有一个朋友列表,他可以独立地与他们聊天.我只需要一点方向

Am just about to start doing an iphone application which is supposed to have a multi user private chat. Something like facebook style, where the user has a list of friends and he can chat with them independently. I just need a little direction here

  1. 如果我有一个用户列表,假设我为聊天创建了个人视图,我该如何处理这些视图?如果 jim 正在与 dick 和 jane 聊天,应该有 2 个视图,每个视图对应一个聊天窗口,对吗?有没有我可以使用的参考资料.

  1. If i have a list of users, let's say i create individual views for the chat, how can I handle these views? If jim is chatting with dick and jane, there should be 2 views, each for one chat window right? Are there any references that i can use.

我正在寻找套接字编程方面的参考资料,我可以在其中从服务器向用户推送消息.我一直在寻找,但找不到任何有用的东西.

I am looking for references in socket programming where i can push messages to the user from the server. I have been looking but could not find anything helpful.

如果我尝试使用本地通知更新用户的聊天窗口,比如说每隔几秒请求一次数据,会不会很耗电?

If i try to update the user's chat window using local notifications, lets say request data every couple of seconds, will that be battery draining?

我真的很喜欢这里的一些方向,我不想开始某事只是意识到它的错误方式.

I would really like some direction here, i do not want to start something just realize its the wrong way.

非常感谢任何帮助

推荐答案

  1. 这些听起来都像是设计决策.例如,您想在单独的视图中显示每个用户的消息吗?这完全取决于您.

  1. Those all sound like design decisions. For example, do you want to display each user's messages in a separate view? That's entirely up to you.

您需要了解 iOS 推送通知.

如果您打算轮询某些服务器以获取更新,那么是的,这将消耗大量电池.推送通知系统正是为了帮助您避免这种情况而创建的.

If you mean that you intend to poll some server for updates, then yes, that will use a lot of battery. This is exactly the sort of situation that the push notification system was created to help you avoid.

这篇关于Xcode 聊天应用,创建动态视图——有点迷失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆