Objective-C++和UDP
有没有用 Objective-C++ 编写的 cocoaasyncsocket 的替代方案?还是很容易转换?我需要为 iPhone Objective-C++ 使用 UDP 库。
Is there an alternative to cocoaasyncsocket written in Objective-C++? Or is it easy to convert? I need to use an UDP library for iPhone Objective-C++.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
看看 网络与互联网起点和CFNetwork 编程Apple 文档中的指南
Take a look at Networking & Internet Starting Point and CFNetwork Programming Guide from Apple docs
将有效的 Objective-C 文件转换为 Objective-C++ 比 1、2、3 更容易;只需将所有
*.m
文件重命名为*.mm
即可完成。Converting valid Objective-C files to Objective-C++ is easier than 1,2,3; Simply rename all
*.m
files to*.mm
and you are done.Objective-C++ 到底是什么意思? Objective-C 还是 C++?
我会首先研究 Apple 的 CoreFoundation,它适用于 OS X 和 iOS。这里有您建立网络所需的一切。例如,有一个 CFSocket 类,它应该足以使用 UDP。
CoreFoundation 是用 C 实现的,因此应该很容易从 Obj-C 或 C++ 代码中使用它。
What exactly do you mean by Objective-C++? Objective-C or C++?
I would look into Apple's CoreFoundation first, which is available for OS X and iOS. There is all you need for doing networking. For example there is a CFSocket class, which should be sufficient to use UDP.
CoreFoundation is implemented in C, so it should be easy to use it from Obj-C or C++ code.