{"id":597,"date":"2018-02-01T11:18:03","date_gmt":"2018-02-01T11:18:03","guid":{"rendered":"http:\/\/mitat.tuu.fi\/?p=597"},"modified":"2018-02-01T11:19:22","modified_gmt":"2018-02-01T11:19:22","slug":"using-c-in-ios-projects","status":"publish","type":"post","link":"http:\/\/mitat.tuu.fi\/?p=597","title":{"rendered":"Using C++ in iOS projects \/ XCode \/ Objective-C \/ Cocoa"},"content":{"rendered":"<p>The trick is an Objective-C wrapper class (which then creates\/calls C++ objects) which is compiled as &#8220;Objective-C++&#8221;. <\/p>\n<p>Create the wrapper class normally but rename the .m file to .mm &#8211; nothing else is needed.<\/p>\n<p>No need to change compile settings &#8211; I tried to do that way and couldn&#8217;t get the project to build without errors.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The trick is an Objective-C wrapper class (which then creates\/calls C++ objects) which is compiled as &#8220;Objective-C++&#8221;. Create the wrapper class normally but rename the .m file to .mm &#8211; nothing else is needed. No need to change compile settings &#8211; I tried to do that way and couldn&#8217;t get the project to build without [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,4,5,3],"tags":[],"class_list":["post-597","post","type-post","status-publish","format-standard","hentry","category-cocoa","category-code","category-iphone","category-objective-c"],"_links":{"self":[{"href":"http:\/\/mitat.tuu.fi\/index.php?rest_route=\/wp\/v2\/posts\/597","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/mitat.tuu.fi\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/mitat.tuu.fi\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/mitat.tuu.fi\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/mitat.tuu.fi\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=597"}],"version-history":[{"count":4,"href":"http:\/\/mitat.tuu.fi\/index.php?rest_route=\/wp\/v2\/posts\/597\/revisions"}],"predecessor-version":[{"id":601,"href":"http:\/\/mitat.tuu.fi\/index.php?rest_route=\/wp\/v2\/posts\/597\/revisions\/601"}],"wp:attachment":[{"href":"http:\/\/mitat.tuu.fi\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=597"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/mitat.tuu.fi\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=597"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/mitat.tuu.fi\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=597"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}