首页 > 同一个应用程序,在iOS8下 两次编译程序,沙盒路径不同

同一个应用程序,在iOS8下 两次编译程序,沙盒路径不同

代码如下,

      NSString *appPath = [[NSBundle mainBundle] bundlePath];
    NSLog(@"appPath is %@", appPath);
     // appPath is /Users/wuxiyao/Library/Developer/CoreSimulator/Devices/45982779-8825-46ED-9444-5441C53401F9/data/Containers/Bundle/Application/AD5C9B5B-79E4-46B2-AE54-E5B495C765A1/IconDemp.app

     NSArray *pathsArray = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
     NSString *documentPathStr = [pathsArray objectAtIndex:0];
     NSLog(@"documentPathStr is %@", documentPathStr);
     // documentPathStr is /Users/wuxiyao/Library/Developer/CoreSimulator/Devices/45982779-8825-46ED-9444-5441C53401F9/data/Containers/Data/Application/511962CD-E713-4495-8752-73AB9A3556A6/Documents

正如上面代码所示,这里我在找我的应用程序里面的.app路径和Document路径,路径是找到了,但是,为什么这里的511962CD-E713-4495-8752-73AB9A3556A6和AD5C9B5B-79E4-46B2-AE54-E5B495C765A1这两个文件夹的名称不同,我记得Xcode5的时候是一样的,是苹果根据哈希算法生成的文件夹名,到了Xcode6就不同了,有知道这是怎么回事的么,

【热门文章】
【热门文章】