I have some pure C++ codes are have I want to change the code as objective C code format. How can do this there is an any tools are there or else how can i do this.
3 Answers
You can compile C++ code to work on the iphone directly. Keep your core as pure C++, and write the bits that need to talk to objective-C libraries as objective-C++ ( .mm
rather than .m
IIRC ).

- 70,661
- 7
- 134
- 187
-
I know this but my thought is i want to change my code pure objective c format – Ben10 Sep 25 '12 at 05:59
It's not possible automatically to translate C++ to Objective-C in the sense that you are asking. Picking just one of the large semantic differences at random, C++ allows multiple inheritance and Objective-C doesn't. You therefore can't map the inheritance graph of C++ onto the inheritance graph of Objective-C.
What you'd do if you were converting manually would be to switch to protocols where what you're meaning to establish is a published set of permissible communications and object composition where you wanted an object to combine some other logic. You'd probably keep the main line of inheritance in a lot of cases. However you're not going to find a tool capable of automating that process.

- 99,986
- 12
- 185
- 204