2016-09-11 5 views
0

テーブルビューとナビゲーションコントローラを使用してリストの基本CRUD操作を設定しています。最初のテーブルビューでプラ​​スボタンをクリックすると、セグを使用して次のテーブルビューをモーダルに表示し、テーブルセルにあるテキストフィールドのリストにアイテムを追加できます。Nav Controllerを搭載したXcode Table View Controllerでテーブルセルが表示されず、セルからデータが処理されています

これまでのように、プラスボタンをクリックすると右のページに移動し、ナビゲーションバーボタンがそのページで機能します。完了をクリックすると、私がストーリーボードに入力したtextFieldのテキストがリストに追加され、どこかにあることがわかります。私は自動レイアウトを設定して、問題ではないはずです。テーブルのセルを覆うもの(すべて濃い灰色)があるように見えますが、それが何であるかわかりません。

this image shows the storyboards, the last board is the one I having trouble with

this images shows the progression of the app as it is now, the middle frame should be showing the text field

コード2番目のビューのための:第二ファイルの

class MissionDetailsTableViewController: UITableViewController { 
@IBAction func cancelBarButtonPressed(sender: UIBarButtonItem) { 
    cancelButtonDelegate?.cancelButtonPressedFrom(self) 
} 

@IBAction func doneBarButtonPressed(sender: UIBarButtonItem) { 
    delegate?.missionDetailsViewController(self, didFinishAddingMission: newMissionTextField.text!) 
} 

@IBOutlet weak var newMissionTextField: UITextField! 
weak var cancelButtonDelegate: CancelButtonDelegate? 
weak var delegate: MissionDetailsViewControllerDelegate? 
override func viewDidLoad() { 
    super.viewDidLoad() 
    // Uncomment the following line to preserve selection between presentations 
    // self.clearsSelectionOnViewWillAppear = false 

    // Uncomment the following line to display an Edit button in the navigation bar for this view controller. 
    // self.navigationItem.rightBarButtonItem = self.editButtonItem() 
} 

override func didReceiveMemoryWarning() { 
    super.didReceiveMemoryWarning() 
    // Dispose of any resources that can be recreated. 
} 

プロトコル:

protocol CancelButtonDelegate: class { 
func cancelButtonPressedFrom(controller: UIViewController) 

}

明確化のために以下のイメージを見ます
protocol MissionDetailsViewControllerDelegate: class { 
func missionDetailsViewController(controller: MissionDetailsTableViewController, didFinishAddingMission mission: String) 

}

+0

2番目のtableViewのコードを表示する – Tim

答えて

0

私はまだ何が起こっていたかわからないが、これは私の仕事:

私は私の第2のビューコントローラのコードのこのデフォルトの行をコメント解除し、私のテーブルセルが現れたことを見ました。私はそれを再現し、それはまだ動作します。

self.navigationItem.rightBarButtonItem = self.editButtonItem() 
関連する問題