小编Yus*_*f X的帖子

OSX上的AWS MQTT

这里的OSX应用程序中,我可以将AWS MQTT与iOS9一起使用,但是当我尝试使用OSX10.11时,我收到此错误:

CFNetwork SSLHandshake失败(-9829)

错误-9828定义为

errSSLPeerCertUnknown = -9829,/*未知证书*/

我的OSX info.plist是

<key>NSAppTransportSecurity</key>
    <dict>
            <key>NSAllowsArbitraryLoads</key>
            <true/>
            <key>NSExceptionDomains</key>
            <dict>
                    <key>amazonaws.com</key>
                    <dict>
                            <key>NSExceptionRequiresForwardSecrecy</key>
                            <false/>
                            <key>NSExceptionAllowsInsecureHTTPLoads</key>
                            <true/>
                            <key>NSThirdPartyExceptionMinimumTLSVersion</key>
                            <string>TLSv1.0</string>
                            <key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
                            <false/>
                            <key>NSIncludesSubdomains</key>
                            <true/>
                    </dict>
                    <key>amazonaws.com.cn</key>
                    <dict>
                            <key>NSExceptionRequiresForwardSecrecy</key>
                            <false/>
                            <key>NSExceptionAllowsInsecureHTTPLoads</key>
                            <true/>
                            <key>NSThirdPartyExceptionMinimumTLSVersion</key>
                            <string>TLSv1.0</string>
                            <key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
                            <false/>
                            <key>NSIncludesSubdomains</key>
                            <true/>
                    </dict>
            </dict>
    </dict>
Run Code Online (Sandbox Code Playgroud)

p12(来自"openssl pkcs12 -info -in awsiot-identity.p12")是:

MAC Iteration 2048
MAC verified OK
PKCS7 Encrypted data: pbeWithSHA1And40BitRC2-CBC, Iteration 2048
Certificate bag
Bag Attributes
    localKeyID: 5F 80 DC 6E AB F1 98 6A AA FC 0B 7B …
Run Code Online (Sandbox Code Playgroud)

macos amazon-web-services ios mqtt

10
推荐指数
1
解决办法
457
查看次数

Realm Swift OSX Cocoapods示例应用程序崩溃

我的步骤是:

1)在Xcode中,我创建了一个新的命令行OSX Swift应用程序并添加了他们的示例"class Dog"代码,并在顶部添加了"import RealmSwift".

2)我添加一个包含两行的Podfile,"use_frameworks!" 和"pod'FynmSwift'"然后运行pod安装.

3)我打开工作区,编译并运行.我收到这个警告:

未运行swift-stdlib-tool:EMBEDDED_CONTENT_CONTAINS_SWIFT已启用,但产品类型"命令行工具"不是包装类型.

而这次崩溃:

dyld:未加载库:@ rpath/libswiftAppKit.dylib引用自:/Users/ys1382/Library/Developer/Xcode/DelivedData/testRealmApp-gxysfwfiirxwddbklmbolznecnld/Build/Products/Debug/RealmSwift.framework/Version/A/RealmSwift原因:图像未找到

到目前为止,谷歌搜索表明警告和崩溃是相关的.有什么建议?

我正在使用OSX El Capitan,Xcode 7.2.1,Cocoapods 0.39.0

macos realm cocoapods swift

7
推荐指数
1
解决办法
1728
查看次数

github我是谁?(OSX)

我想我是github USER_A,但github认为我是USER_B.首先,我检查一下我是谁:

$ git config --list
color.ui=auto
push.default=simple
user.name=USER_A
user.email=USER_A@gmail.com
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
core.ignorecase=true
core.precomposeunicode=true
remote.origin.url=https://github.com/USER_A/MY_REPO.git
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.master.remote=origin
branch.master.merge=refs/heads/master
Run Code Online (Sandbox Code Playgroud)

然后,我git克隆我的回购:

$ git clone https://github.com/USER_A/MY_REPO.git
Cloning into 'MY_REPO'...
remote: Counting objects: 9, done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 9 (delta 0), reused 0 (delta 0), pack-reused 6
Unpacking objects: 100% (9/9), done.
Checking connectivity... done.
Run Code Online (Sandbox Code Playgroud)

然后我改变了一些东西,提交并推送:

$ git push
remote: Permission to USER_A/MY_REPO.git denied to USER_B.
fatal: unable to access 'https://github.com/USER_A/MY_REPO.git/': The requested URL …
Run Code Online (Sandbox Code Playgroud)

git macos github

6
推荐指数
2
解决办法
1万
查看次数

斯威夫特字典理解

其他语言(如Python)允许您使用字典理解来从数组中创建一个字典,但我还没有弄清楚如何在Swift中执行此操作.我以为我可以使用这样的东西,但它不能编译:

let x = ["a","b","c"]
let y = x.map( { ($0:"x") })
// expected y to be ["a":"x", "b":"x", "c":"x"]
Run Code Online (Sandbox Code Playgroud)

在swift中从数组生成字典的正确方法是什么?

dictionary-comprehension swift

5
推荐指数
1
解决办法
727
查看次数

Mac OSX Sierra 中的 TIC 读取错误

当我在 OSX 10.12 上运行我的应用程序时,我在日志中看到此错误,即使我的应用程序仍然正常运行:

error   11:31:23.274910 -0700   MyApp   TIC Read Error [76:0x6000001945d0]: 1:57
error   11:32:24.774500 -0700   MyApp   TIC Read Error [77:0x608000193590]: 1:57
error   11:33:24.903966 -0700   MyApp   TIC Read Error [79:0x61800018cd90]: 1:57
error   11:33:42.201840 -0700   MyApp   TIC Read Error [63:0x6000001911d0]: 1:57
error   11:33:42.201908 -0700   MyApp   TIC Read Error [70:0x6100001938d0]: 1:57
error   11:33:42.217283 -0700   MyApp   TIC Read Error [60:0x61800018df70]: 1:57
error   11:33:42.217388 -0700   MyApp   TIC Read Error [53:0x600000190cf0]: 1:57
error   11:33:42.338048 -0700   MyApp   TIC Read Error [66:0x618000192140]: 1:57
error   11:34:25.216051 -0700   MyApp …
Run Code Online (Sandbox Code Playgroud)

macos

5
推荐指数
1
解决办法
5453
查看次数