I am trying to expose the pathForResource functionality to C++ from objective-c.
However, I am very new to objective-c and have not been able to discern how to use a c string as an argument in objective-c. clearly I have the wrong idea here.
how do i get pathForResource to use c strings as an argument?
here is my function:
static std::string getAssetPath(std::string name, std::string ending)
{
const char * nameChar = name.c_str();
const char * endingChar = ending.c_str();
NSString* assetPath = [NSBundle pathForResource:&nameChar
ofType:&endingChar];
std::string str;
str = std::string([assetPath cStringUsingEncoding: NSASCIIStringEncoding]);
return str;
}