mailcore2を使ってメールを自動送信する機能を追加しようとしたのですがうまく起動しませんでした。
cocoa podsを使ってインストールしてBridgingHeaderファイルを作成して以下のように書き込みmailcore2のクラスを使おうとしたのですが以下のようなエラーが発生してしまいました。
調べてみたのですが解決法がなかなか見つからず困っております。
よければ回答お願いします。
pod fileの中身です。
lang
1# Uncomment the next line to define a global platform for your project 2platform :ios, '9.0' 3 4target 'TimeCapsuleNeo' do 5 # Comment the next line if you're not using Swift and don't want to use dynamic frameworks 6 use_frameworks! 7pod ‘mailcore2-ios’, ‘~>0.5.1’ 8 # Pods for TimeCapsuleNeo 9 10 target 'TimeCapsuleNeoTests' do 11 inherit! :search_paths 12 # Pods for testing 13 end 14 15 target 'TimeCapsuleNeoUITests' do 16 inherit! :search_paths 17 # Pods for testing 18 end 19 20end
エラー箇所の詳細なコードです。
label2はoutletで接続したlabelです。
var year:Int? var month:Int? var day:Int? override func viewDidLoad() { super.viewDidLoad() label2.text=NSLocalizedString(String(describing: year!)+"/"+String(describing: month!)+"/"+String(describing: day!)+" message will arrive", comment: "") print(String(describing: year)+"年 "+String(describing: month)+"月 "+String(describing: day)) var smtpSession=MCOSMTPSession() // Do any additional setup after loading the view, typically from a nib. } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. }
Podfileを書いて下さい。インストールしたMailCoreのバージョンを書いて下さい。ビルドしてもエラーが消えないのでしょうか?
# Uncomment the next line to define a global platform for your project platform :ios, '9.0' target 'TimeCapsuleNeo' do # Comment the next line if you're not using Swift and don't want to use dynamic frameworks use_frameworks! pod ‘mailcore2-ios’, ‘~>0.5.1’ # Pods for TimeCapsuleNeo target 'TimeCapsuleNeoTests' do inherit! :search_paths # Pods for testing end target 'TimeCapsuleNeoUITests' do inherit! :search_paths # Pods for testing end end で書きました。ビルドしても消えませんでした。
ここに書かないで下さい。
本文に書きなおしました
コードは ``` で囲って下さい。(自分の書き込みを見ておかしいと思わないのでしょうか?)
すいません。
一度クリーンしてみて下さい。(Option+Shift+Comand+K)/エラーの出ている行のコードを質問欄に書いて下さい。(必ずコピペして下さい)/MailCoreの最新版を使わない理由はあるのでしょうか?(ちなみに、こちらでは0.5.1、0.6.4ともに正常にビルド出来ています)
クリーンした結果も変わらず同じエラーが出続けました。/記載しました。/古い記事を記載したサイトを見てそのままの手順でやってしまいました。
理由は特にないです
もう一度プロジェクトを作り直すことをおすすめします。
そうしてみます。回答ありがとうございました。
回答1件
あなたの回答
tips
プレビュー