2

I'm working on a fairly low-key, low budget project that's having trouble issues with their server load when we release a new patch. For our solution, we decided that using torrenting to distribute our patches would be far superior than our current method. As of yet, we haven't been able to actually find a pre-built library to do this, so we settled on libTorrent. However, libTorrent is written in C++, which is slightly problematic. Our preferred solution is to use libTorrent as a framework, then just write our patching code. However, none of us are sure how to actually go about doing such.

How do we go about this? Googling turned up Objective-C++ wrapping with the .mm extension. How would you do that in a framework?

John Leidegren
  • 59,920
  • 20
  • 131
  • 152
Jonathan Howard
  • 216
  • 1
  • 10

1 Answers1

1

The steps don't really differ from writing a plain Objective-C framework, you will just be using Objective-C++ for at least some of the source files and wrap the C++ parts with Objective-C interfaces.

Using Objective-C++ in a framework works exactly the same as in applications; you only need to be careful about keeping C++ types out of the exported headers (at least if you don't want to force the user to use Objective-C++). To achieve that you might need opaque pointers.

Community
  • 1
  • 1
Georg Fritzsche
  • 97,545
  • 26
  • 194
  • 236