NSCocoaErrorDomain Code=256

前端 未结 7 949
太阳男子
太阳男子 2020-12-01 20:59

I have been stuck with this for a while and don\'t seem to get around this.

I am trying to read the contents of an URL as a string from an URL, But i get a weird

7条回答
  •  星月不相逢
    2020-12-01 21:25

    Sandboxing

    If you're using sandboxing in your app, you might want to check that com.apple.security.network.client is set to YES. It's in the the General tab of your Target in Xcode 5 under

    Network: Outgoing Connections (Client)

    Also be aware that if you see a code 257 when trying to reach a file:/// url, that's also probably because of sandboxing, but this time rather the File Access part. Because I didn't want to open it to anything else than `com.apple.security.files.user-selected.read-write'

    User selected files

    I preferred to use A Dead Simple Fileserver and use http://localhost:3000 when in Debug mode.

提交回复
热议问题