I had a trouble to combine c++ and objective-c together in developing a iphone app. I had a 3rd party library to use in the app. I had a plan to use c or c++ to wrap the library and then use objective-c to call it. After I had finished the class with c++, I had a trouble to use it in objective-c. Is there any sample code? Thanks.
in the objective-c head file. I write
#import <UIKit/UIKit.h>
#import "ZJTConstants.h"
#include "TTSAdapter.h"
class Adapter;
@interface ZJTVBlogViewController : UIViewController {
@private
Adapter* adapter;
}
@end
and in the mm file, I write:
if (self) {
adapter = Adapter::getInstance();
// Custom initialization
}
Is it write?
.mm
file, so, what's the trouble? you have not told us what problem you are facing. – Toscana