http://radar.oreilly.com/2014/09/multipeer-connectivity-on-ios-8-with-swift.html
このページにあるアプリケーションをXcode7.3、で動かしたいのですが、2種類のエラーで動きません。
該当部分は
Swift2
1 let msg = self.messageField.text.dataUsingEncoding(NSUTF8StringEncoding, 2 allowLossyConversion: false)
に
value of optional type ‘String?’ not unwrapped; did you mean to use ‘!’ or ‘?’?
のエラー文と
Swift2
1 self.updateChat(msg, fromPeer: peerID)
に
Cannot convert value of type 'NSString?' to expected argument type 'String?'
のエラー文です。
そもそもエラーの発生理由が分からず、どう手を付ければいいかわかりません。
申し訳ありませんがご教授お願いします。
あなたの回答
tips
プレビュー