File path

File path
0.0 0


When loading my xml on win32 I use “…/Resource/file.xml” and it works fine. But when I run it on the ios it fails to load the file.
So I was thinking it could have something to do with the filepath? Or what else can be the different?


please use the wrapped CCFileUtils::getFileData(…) to read files on multi-platform.


I am using that function. Failing at fopen in that function.


I think you should use “file.xml”.
The parameter you used should be relative path of the “Resource” folder.

On win32, it’s works fine because of the resource file can be find if the parameter is the relative path of your code file.
But it’s not supportted by the other platforms.


Hmmm I was wondering which parameter did you think of? Cus with just file.xml it do not work, but Im not sure where i specify that it should be relative?


It depends on how you add file.xml into your xcode project, but not the physics path on your disk.
Can you past a screenshot of the file list contenting file.xml in your xcode?


Im not so familiar with xcode and how to use it, but I right clicked on the Resource folder in xcode, Add Files, then selected my xml file.


I solved it by using this solution
Thanks anyway.


I just taking screenshot to describe the difference of “create groups for any added folders” & “create folder references for any added folders” in xcode in this thread. But seems I don’t need to do now :slight_smile: