Reputation: 129
I've been learning C++ and SFML for quite a while now, and love the language and library, as it works well for me. I've gotten interested in making iPhone apps, which I realize uses Objective-C.
Anyway, my question is, is there a way for me to call the use of C++ code (with SFML) in Objective C. So while the program would work on an iPhone, the actual code is written mainly in C++?
Sorry if that's not.... descriptive enough, if you need more clarification, feel free to ask!
Thanks in advance!
Upvotes: 0
Views: 119
Reputation: 26395
Yes. In fact, you would probably use Objective-C++. Name your source files with the ".mm" extension instead of the ".m" extension, and the compiler will compile them as Objective-C++. There's even a Wikipedia article about it. You can also use regular C++ source files in your code and call them from Objective-C classes in this scenario. If you have more specific questions about it, feel free to ask.
Upvotes: 2