【发布时间】:2014-11-22 20:21:58
【问题描述】:
我正在尝试使用
创建一个文件夹BOOL status =[fileManager createDirectoryAtPath:[[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:pathComponent] withIntermediateDirectories:YES attributes:nil error:&error];
status 在 iOS7(设备和模拟器)、iOS8(仅限模拟器)中为 YES。
但在 iOS 8 设备中,状态为 NO & 错误描述 = Operation couldn't be completed. Operation not permitted
[[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:pathComponent 的值
在 iOS 7 中
/var/mobile/Applications/7AC7128C-1926-41AC-9108-4C85D0D75AE9/HelloWorld.app/../Library/Pages/CSS
在 iOS 8 中
/private/var/mobile/Containers/Bundle/Application/1E2D5D54-2585-4CB9-BD00-24C4BF873421/HelloWorld.app/../Library/Pages/CSS
为什么我只在 iOS8 设备中收到 Operation Couldn't be completed 错误?
【问题讨论】:
标签: ios objective-c ios8 xcode6 nsfilemanager