2016-05-18 7 views
1

タブ内に2つのtableViewが表示されています。開いた最初のもののために、エラーはありませんが、2番目のタブを選択すると、エラーが表示されます。識別子「GroupMessageCell」のセルをデキューできません。

2016-05-17 21:07:23.730 FeastApp[11007:172938] *** Assertion failure in -[UITableView dequeueReusableCellWithIdentifier:forIndexPath:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit_Sim/UIKit-3512.60.7/UITableView.m:6573 
2016-05-17 21:07:23.736 FeastApp[11007:172938] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'unable to dequeue a cell with identifier GroupMessageCell - must register a nib or a class for the identifier or connect a prototype cell in a storyboard' 

私のように行識別子を設定しているにもかかわらず:GroupMessageCell

enter image description here

enter image description here

とクラス:私のネストされたテーブルビュー内の

class GroupMessageList: UITableViewController { 

    var getGroups: Firebase! 
    var groups: [Group] = [] 

    override func viewDidLoad() { 
     super.viewDidLoad() 

     getGroupsWithMessages() 

    } 

    override func viewWillAppear(animated: Bool) { 

     super.viewWillAppear(animated) 
    } 

    // MARK: - Table View 

    override func numberOfSectionsInTableView(tableView: UITableView) -> Int { 
     return 1 
    } 

    override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { 

     return self.groups.count 
    } 

    override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { 
     let cell = tableView.dequeueReusableCellWithIdentifier("GroupMessageCell", forIndexPath: indexPath) 
     let group: Group 

     group = groups[indexPath.row] 

     // Update the rows with the proper object 
     cell.textLabel!.text = "\(group.groupName) \(group.groupID)" 
     return cell 
    } 

    func getGroupsWithMessages() { 

     getGroups = Firebase(url: Global.sharedInstance.firebaseMainURL + "usersGroups/" + Global.sharedInstance.userID) 

     self.getGroups.observeSingleEventOfType(.Value, withBlock: { snapshot in 

      print(snapshot) 

      for detailData in snapshot.children { 

       // print(detailData.value) 

       self.groups.append(Group(groupName: "test", groupID: detailData.key)) 

       print(self.groups.count) 

      } 

      self.tableView!.reloadData() 

     }) 
    }   
} 

このエラーが発生しないようにするにはどうすればよいですか?

答えて

1

三のポテンシャルトラブル地:

  1. セル識別子が存在していることを確認 - [微あなたの内容に基づいて、ルックス]

  2. をあなたのようなストーリーボード上GroupMessageListにごTableViewControllerのクラスを設定しましたso:custom table view class

  3. [製品]> [クリーン]を実行した後でもエラーは発生しますか?

これらのうちの1つが役立ちます。

+0

私はすでに今正常に動作し、私はすべてを削除し、通常のように正確にそれを設定し、このすべてが、エラーpersits .... – Sauron

+0

を行っています。.. – Sauron

+0

Gremlins。あなたがそれを整理してうれしいです。 –

2

あなたはそのクラスGroupMessageCeを検証選択ストーリーボードと

enter image description here

、その後

enter image description here

を行うためにGroupMessageCellため

をするクラスを設定していませんLL

セット識別子

enter image description here

+0

クラス 'GroupMessageCell'はありません。私は個々のメッセージタブと全く同じ設定をしていますが、はいエラーは持続します... – Sauron

+0

私はすべてを削除し、正常に正しく設定しました。 – Sauron

関連する問題