1

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.

0

3 Answers 3

5

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 ).

Sign up to request clarification or add additional context in comments.

1 Comment

I know this but my thought is i want to change my code pure objective c format
1

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.

Comments

0

You can refer following question :here

and you can compile c++ code directly by changing vc.m to vc.mm

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.