Help us understand the problem. What is going on with this article?

AppGroup 内部にディレクトリを作る際のエラー

More than 5 years have passed since last update.

AppGroup の共有領域内にディレクトリを作成しようとすると下記のようなエラーが出る。

Error: Unable to create directory: Error Domain=NSCocoaErrorDomain Code=513 "操作を完了できませんでした。(Cocoa エラー 513。)" UserInfo=0x15614530 {NSFilePath=file:/private/var/mobile/Containers/Shared/AppGroup/1C808679-78C6-4A2F-934B-0742817963BA/Directory, NSUnderlyingError=0x1562f730 "操作を完了できませんでした。Operation not permitted"}

その際に参照した解決法がこちら

iOS8 Unable to create a folder/file under app group shared container location

解決はしたがなぜ、pathはよくてabsoluteString はだめなのか気になったので軽く調査。
結論を言うとパスの値が微妙に違う
absoluteString はプロトコル部分も含めてパスを渡してきているが、path の方はディレクトリパスのみを渡してきている。

path
/private/var/mobile/Containers/Shared/AppGroup/1C808679-78C6-4A2F-934B-0742817963BA

absoluteString
file:///private/var/mobile/Containers/Shared/AppGroup/1C808679-78C6-4A2F-934B-0742817963BA/

color_box
帰ってください
esm
We build applications which work well and make customers happy.
http://www.esm.co.jp
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした