Amir Saniyan
Amir Saniyan

Reputation: 13729

Is there any way to using Cocoa in a C++ project?

I want to use Cocoa APIs in C++ project instead of Carbon.

Is there any way to using Cocoa in a C++ project? Is it possible using Cocoa while developing a C++ project?

Upvotes: 2

Views: 82

Answers (1)

trojanfoe
trojanfoe

Reputation: 122391

My app uses a C++ library to provide its functionality and almost every source file is Objective-C++ (.mm). There is no problem at all with this and it's working well.

I am careful to avoid using statements like using namespace std; and using namespace MyLibrary; in order to make it obvious (at least to me) where I am using parts of the Standard Library, my library or Cocoa runtime; for example:

std::string s = ...;
MyLibrary::MyObject o = ...;
NSString *nss = ...;

Upvotes: 3

Related Questions