`
shappy1978
  • 浏览: 715082 次
  • 性别: Icon_minigender_1
  • 来自: 广州
社区版块
存档分类
最新评论

Directory Changes in iOS8

 
阅读更多

1 Seperate the bundle and sandbox directory, and each time you run the app, the uuid will be changed in both path, bellow demo shows document, home and main bundle

2014-09-29 22:53:15.060 HelloWorld[993:157357] /var/mobile/Containers/Data/Application/9B0DF5DF-0009-4197-9286-085391FB27D3/Documents

2014-09-29 22:53:15.062 HelloWorld[993:157357] /var/mobile/Containers/Data/Application/9B0DF5DF-0009-4197-9286-085391FB27D3

2014-09-29 22:53:15.062 HelloWorld[993:157357] /private/var/mobile/Containers/Bundle/Application/DDCCC2B2-0BDA-4E93-85AB-C7374136039E/HelloWorld.app

 

2 XCode will get exception while webview try to read a PDF in main bundle,  and show an error:

DiskImageCache: Could not resolve the absolute path of the old directory.

But app won't crash, some message said change loadData to loadRequest, but it don't work, no solution found now.

    NSString *documentsDirectory = [[NSBundle mainBundle] pathForResource:@"test" ofType:@"pdf"];

//    NSData *data = [NSData dataWithContentsOfFile:documentsDirectory];

//    NSData *data = [NSData dataWithContentsOfURL:[NSURL fileURLWithPath:documentsDirectory]];

//    NSString *sMimeType = @"application/pdf";

    

    UIWebView *webView = [[UIWebView alloc] initWithFrame:self.view.bounds];

    [self.view addSubview:webView];

//    [webView loadData:data MIMEType:sMimeType textEncodingName:@"utf-8" baseURL:nil];

 

    [webView loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:documentsDirectory]]];

 

 

分享到:
评论

相关推荐

    2d toolkit 2.0 hotfix 2

    tk2dUiManager.OnMouseWheelChange -> OnScrollWheelChange to stop Unity warning during iOS build because function name starts with OnMouse. textInput.SetFocos / IsFocus Sprite handles disable themselves...

    Xcode_Build_Setting_Reference

    Adjusting this value allows developers to manage changes in the library’s API without breaking existing applications that depend on it. ##### DYLIB_CURRENT_VERSION (Current Library Version) This ...

    Programming.Microsoft.Office.365.epub

    Books in this program will receive periodic updates to address significant software changes for 12 to 18 months following the original publication date via a free Web Edition. Learn more at ...

    ICS delphixe10源码版

    The history of changes in each source file list all developers having contributed (When no name is given, the change is by F. Piette). I can't list all contributors here but I want to specially ...

    Microsoft MS-102最新

    Datum、Litware Inc.、Fabrikam 和 Misc. Questions。这五个主题涵盖了 Microsoft 365 的各个方面,包括身份验证、授权、设备管理、安全性和合作等。 考试题目 考试题目共有 312 道,涵盖了各种题型,包括多选题...

    ebook-flutter-revolution.pdf

    To configure the Flutter SDK on Windows, you need to add the Flutter bin directory to your system's `PATH` variable. This can be done through the System Properties dialog or by editing the environment...

    softap_ap6212a0_tinav2.1_验证通过_旧版本的系统_20170915_1223没有外层目录.7z

    8. azalea_perf3-dragonboard 9. octopus_dev-tina 10. octopus_dev-dragonboard 11. astar_evb-tina 12. azalea_perf1-tina 13. azalea_perf1-dragonboard 14. astar_parrot-tina 15. astar_parrot-...

Global site tag (gtag.js) - Google Analytics