每次运行后,Xcode 6都会在iOS8模拟器中重命名我的应用程序目录。 [英] Xcode 6 keeps renaming my app's directory in iOS8 simulator after each run.
问题描述
我正在运行Xcode 6 Beta 5,但自第一次测试以来,这种情况一直在发生。模拟器中的应用程序目录在每次运行后都会被重命名。我花了一段时间来弄明白这一点。我正在使用它来获取doc的dir参考。
I'm running Xcode 6 Beta 5 but this has been happening since the first beta. My app's directory in the simulator keeps being renamed after each run. It took me a while to figure this out. I'm using this to get the doc's dir reference.
NSString *folder = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,
NSUserDomainMask,
YES) lastObject];
NSLog(@"Documents Dir: %@",folder);
现在例如在第一次运行时它将是:
Now for example on the first run it'll be:
/ Users / Joey / Library / Developer / CoreSimulator / Devices / 5B9930EE-A9B4-4B36-BABB-AA864ACAF2DE / data / Containers / Data / Application / 4B10C2E4-A5C3-4C64-93B1-4069FCCB9C46 / Documents
/Users/Joey/Library/Developer/CoreSimulator/Devices/5B9930EE-A9B4-4B36-BABB-AA864ACAF2DE/data/Containers/Data/Application/4B10C2E4-A5C3-4C64-93B1-4069FCCB9C46/Documents
现在第二次运行:
/ Users / Joey / Library / Developer / CoreSimulator / Devices / 5B9930EE-A9B4-4B36-BABB-AA864ACAF2DE / data / Containers / Data / Application / 7E9EB62D-115A-4092-AD23-CB6BA3E5E10F / Documents
/Users/Joey/Library/Developer/CoreSimulator/Devices/5B9930EE-A9B4-4B36-BABB-AA864ACAF2DE/data/Containers/Data/Application/7E9EB62D-115A-4092-AD23-CB6BA3E5E10F/Documents
第三次运行:
/ Users / Joey / Library / Developer / CoreSimulator / Devices / 5B9930EE-A9B4-4B36-BABB-AA864ACAF2DE / data / Containers / Data / Application / EC8F41E8-52ED-4B10-9808-B3ACC46FC6AA / Documents
/Users/Joey/Library/Developer/CoreSimulator/Devices/5B9930EE-A9B4-4B36-BABB-AA864ACAF2DE/data/Containers/Data/Application/EC8F41E8-52ED-4B10-9808-B3ACC46FC6AA/Documents
这对我的应用程序造成严重破坏,因为它存储了某些路径引用应用程序中的文件。这不是我的NSLog语句返回不正确的结果,我验证这是在Finder中发生的事情。它每次都在改名。有没有人看到过这种情况?这是一个我误解的功能吗?
This is wreaking havoc with my app because it stores path references for certain files within the app. It's not that my NSLog statement is returning incorrect results, I verified this is what happening in Finder. It's changing the name every time. Has anyone seen this happen? Is this a "feature" that I'm misunderstanding?
推荐答案
事实证明Xcode 6实际上每次运行都会更改应用程序的UUID ,我存在绝对路径的错误。
Turns out Xcode 6 does in fact change the app's UUID every run, and I'm in the wrong for storing absolute paths.
这篇关于每次运行后,Xcode 6都会在iOS8模拟器中重命名我的应用程序目录。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!