Question: I have 5 imageviews and I am updating them based on value but the problem is for updating all of them I have redundant code for eacg image updation expect the specific imageView object. Here is example, I have such 5 methods to update each imageview which I guess is not optimal solution. 

```
 public void imageThird(int value){
    third.setVisibility(View.VISIBLE);
    if(value >= 1000 && value <= 800) {
        third.setImageResource(R.drawable.sa);
    }
    else if(value >= 800 && value <= 500) {
        third.setImageResource(R.drawable.sb);
    }
    else if(value >= 500 && value <= 300) {
        third.setImageResource(R.drawable.sc);
    }
    else if(value >= 300 && value <= 150) {
        third.setImageResource(R.drawable.sd);
    }
    else if(value >= 150 && value <= 50) {
        third.setImageResource(R.drawable.se);
    }
    else {
        third.setImageResource(R.drawable.sa);
    }
}

```

So I have 5 like this method, which is not good I guess, the only difference is the imageview object for each image. May be it is silly question I am not much aware about how images works in Andorid.

Answer: 
This happened with me when I was registering cell in ViewDidLoad method using `tableView.register(AnyClass?, forCellReuseIdentifier: String)` When i commented this line and added the cell class and cell identifier in storyboard, it started working. Again if I uncomment that code in viewdidload, it stops working.
for calling the method prepareForSegue you must have to add a segue to connect the prototype cell and the destination Controller! method doesn't called if you navigate to destination controller programmatically!