ObjC Link

scapix::link::objc library provides functions to convert between C++ and Objective-C types. It may be used on it’s own in any application, or in a platform dependent part of an application utilizing Scapix Language Bridge.

Example:

#include <scapix/link/objc/convert.h>

using namespace scapix::link::objc;

void test()
{
    // Use convert_cpp() and convert_objc() functions to convert between C++ and Objective-C types.
    // This works for any type supported by scapix::link::objc::convert<> interface,
    // which supports many STL types and can be extended for your own types.

    auto version = convert_cpp<std::string>([[NSProcessInfo processInfo] operatingSystemVersionString]);
    auto arguments = convert_cpp<std::vector<std::string>>([[NSProcessInfo processInfo] arguments]);
    auto environment = convert_cpp<std::map<std::string, std::string>>([[NSProcessInfo processInfo] environment]);
}