title: ios opencv filepath of cascade file
body: <p>I am new to ios. Currently I am working on an app that uses opencv facetracker. 
  Therefore I use C++ within Objective-C. My problem is, that the contructor of the C++ class, which handles the facetracking part, needs the file location of the cascade file. The Constructor looks like this:</p>
  
  <pre><code>VideoFaceDetector(const std::string cascadeFilePath);
  </code></pre>
  
  <p>Unfortunately the following code does not work(filepath changed for anonymity reasons):</p>
  
  <pre><code>const cv::String    CASCADE_FILE("/../../../../haarcascade_frontalface_default.xml");
  </code></pre>
  
  <p>Although the haarcascade_frontalface_default.xml file is within the Xcode project, it can not be loaded.
  Is there a way to get the filepath of the cascade file within the C++ code? I have tried the approach from User: r4ghu</p>
  
  <pre><code>NSString *faceCascadePath = [[NSBundle mainBundle]
                               pathForResource:@"&lt;your_cascade_name&gt;"
                               ofType:@"xml"];
  const CFIndex CASCADE_NAME_LEN = 2048;
  char *CASCADE_NAME = (char *) malloc(CASCADE_NAME_LEN);
  CFStringGetFileSystemRepresentation( (CFStringRef)faceCascadePath,
                                      CASCADE_NAME,
                                      CASCADE_NAME_LEN);
  if(!face_cascade.load(CASCADE_NAME)) {
      cout &lt;&lt; "Unable to load the face detector!!!!" &lt;&lt; endl;
      exit(-1);
  }
  </code></pre>
  
  <p>It did not work for me. 
  Is there any other way? </p>
  
  <p>thx </p>