Log in or register to post comments

Read XML From Document Folder

June 28, 2012 - 8:35am #3

Dear all;

For my application requirements, I Placed my "XML and DAT" Files in this path: 

"var/mobile/Applications/AF238966-5A74-A656-9C50370BBDC7/Documents/MyTrackble.xml"

So i loaded my dataset in ImageTargetAppDelegate.mm by this line:

[qUtils addTargetName:@"Stones & Chips" atPath:@" var/mobile/Applications/AF238966-5A74-A656-9C50370BBDC7/Documents/MyTrackble.xml "];

unfortunately, it gives me this error "Failed to load data set"

this mean that it can't read my path ... what's the problem?

Read XML From Document Folder

July 5, 2012 - 2:49am #2

Hi Khaled1989

Just use the file name - you do not need the directory i.e.

[qUtils addTargetName:@"Stones & Chips" atPath:@"MyTrackble.xml "];

However in QCARUtils.mm you need to use STORAGE_ABSOLUTE rather than STORAGE_APPRESOURCE if you put the files in a directory rather than the App Bundle  i.e.

            NSString *fullPath = [NSString stringWithFormat:@"%@/Documents/%@",NSHomeDirectory(),dataSetPath];

            

            if (!theDataSet->load([fullPath cStringUsingEncoding:NSASCIIStringEncoding], QCAR::DataSet::STORAGE_ABSOLUTE))

            {

                msg = msgFailedToLoad;

                errorCode = QCAR_ERRCODE_LOAD_DATASET;            

                imageTracker->destroyDataSet(theDataSet);

                theDataSet = nil;

            }

 
Look at QCARUtils.mm for more info
 
HTH
 
N

 

 

Read XML From Document Folder

July 5, 2012 - 4:45am #1

Thank you it is work very well

Log in or register to post comments