Menu

iOS test project doesn't work

Bruno
2013-07-30
2013-08-01
  • Bruno

    Bruno - 2013-07-30

    I downloaded "xlslib-package-2.4.0.zip" and did run TestDHxlsIOS.xcodeproj in XCode 4.6.3. The project compiles without warning or error and the app runs in simulator but doesn't create a file. It just displays an empty gray screen and writes to log:
    OK - bye! fud=0

    There is no file in the app folders So it seems it doesn't work. Or what is the expected result?

     
    • David Hoerl

      David Hoerl - 2013-08-01

      I'll look at it again, but it probably does create a file in /tmp (simulator) - the idea is to show that you can actually get it to do something. Change the location of the saved file to a valid location on an iOS device and it should work.

      It took forever to just get this thing to run on iOS - so the demo app is just to show how to use it, not that it does anything useful. That you get the OK message and fud=0 (which is the error return I recall) means it worked.

       
  • Bruno

    Bruno - 2013-07-30

    Found out in the meantime. The writeFile statement needs to be replaced as follows:

    int fud = [dhWB writeFile:[self dataFilePath:@"foo.xls"]];

    • (NSString )dataFilePath:(NSString )parmFile {
      NSArray paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
      NSString
      documentsDirectory = [paths objectAtIndex:0];
      if (parmFile==nil) {
      return [documentsDirectory stringByAppendingString:@"/"];
      } else {
      return [documentsDirectory stringByAppendingPathComponent:[NSString stringWithFormat:@"%@",parmFile]];
      }
      }
     

Log in to post a comment.