user1988
user1988

Reputation: 811

using c++ files in objective c sample tutorial

Where can I get sample tutorial where I can get how to use visual C++ files in XCODE using objective c? I am working on app which is having multiple visual C++ files. Basically this is an gaming application which is developed for windows. And now want to develop it on iPad. So can I reuse those files?

Thank you in Advance.

Upvotes: 0

Views: 230

Answers (1)

David Hoerl
David Hoerl

Reputation: 41642

You can just add the c++ files directly to Xcode and it will compile them (assuming you have all the proper headers etc). You can create 'bridges' to that code by using ObjectiveC++ - meaning you can set the suffix of an ObjectiveC file to '.mm' and the methods in the file will be visible to any other ObjectiveC object, but you can instantiate C++ objects too. In fact if you have C++ ivars (object variables), they get the proper destruct messages when the ObjectiveC class is released. Google 'ObjectiveC++' for more info.

Upvotes: 1

Related Questions