以下のURLにあるライブラリをインストールして使おうとしているのですが、うまくいかないためそのDEMOを真似して自分のプログラム上で動かそうとしています。
https://github.com/shin8484/PopupWindow
因みにそのDEMOは動いています。
DEMO内のviewcontrollerのソースの一部が以下の様になります。
swift
1import UIKit 2import PopupWindow 3 4class ViewController: UIViewController { 5 @IBOutlet weak var tableView: UITableView! 6 7 override func viewDidLoad() { 8 super.viewDidLoad() 9 tableView.delegate = self 10 tableView.dataSource = self 11 } 12 13 @available(iOS 11.0, *) 14 override func viewSafeAreaInsetsDidChange() { 15 super.viewSafeAreaInsetsDidChange() 16 tableView.contentInset.bottom = view.safeAreaInsets.bottom 17 tableView.contentInset.top = view.safeAreaInsets.top 18 } 19}
ストーリーボードにDEMOのviewcontrollerSceneをコピペしてそこのtableViewを自分のコードに紐付け以上と同じコードを書いたのですが以下の様にエラーが出ています。
swift
1import UIKit 2import PopupWindow 3 4 5 6class MainpageViewController: UIViewController { 7 8 9 @IBOutlet weak var tableview: UITableView! 10 11 12 override func viewDidLoad() { 13 super.viewDidLoad() 14 tableView.delegate = self //エラーCannot assign value of type 'MainpageViewController' to type 'UITableViewDelegate?' 15 tableView.dataSource = self //エラーCannot assign value of type 'MainpageViewController' to type 'UITableViewDataSource?' 16 // Do any additional setup after loading the view. 17 } 18 19 @available(iOS 11.0, *) 20 override func viewSafeAreaInsetsDidChange() { 21 super.viewSafeAreaInsetsDidChange() 22 tableView.contentInset.bottom = view.safeAreaInsets.bottom //エラーUse of unresolved identifier 'tableView' 23 tableView.contentInset.top = view.safeAreaInsets.top //エラーUse of unresolved identifier 'tableView' 24 } 25} 26
これはどういう事でしょうか?
------追記ですーーーーーーーーーー
すみません確かに大文字と小文字間違えていました。。。ただそれでも最初の2つの方のエラーが取れません・・・こちらの原因はなんなのでしょうか。。。?
回答3件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/08/28 12:56
2018/08/28 14:04 編集
2018/08/28 14:09