今まで出てなかったのですが急にThread 1:signal SIGABRTのエラーが出てしまいました。
これまではエラーがでなくてコードは間違っていないと思うのですが、何が原因でしょうか?
Swift
1 2import UIKit 3 4class CollectionViewController: UICollectionViewController { 5 6 var Array = [String]() 7 8 var ButtonArray = [String]() 9 10 11 override func viewDidLoad() { 12 super.viewDidLoad() 13 // Do any additional setup after loading the view, typically from a nib. 14 15 Array = ["平成27年","平成27年","平成26年","平成26年","平成25年","平成25年","平成24年","平成24年","平成23年","平成23年","平成22年","平成22年"] 16 17 ButtonArray = ["上期","下期","上期","下期","上期","下期","上期","下期","上期","下期","上期","下期"] 18 19 } 20 21 override func didReceiveMemoryWarning() { 22 super.didReceiveMemoryWarning() 23 // Dispose of any resources that can be recreated. 24 } 25 override func collectionView(collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { 26 return Array.count 27 } 28 29 override func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell { 30 let cell = collectionView.dequeueReusableCellWithReuseIdentifier("cell", forIndexPath: indexPath) as UICollectionViewCell 31 32 let label = cell.viewWithTag(1) as! UILabel 33 34 label.text = Array[indexPath.row] 35 36 let Button = cell.viewWithTag(2) as! UIButton 37 38 39 Button.setTitle(ButtonArray[indexPath.row], forState: UIControlState.Normal) 40 41 42 43 return cell 44 } 45 46}
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。