static tableview connect to an another dynamic tableview

I play around with UITableViews. Now I do have one static table view connect to an dynamic table view. Even I click on the row from the static table view, it should change AND SHOW UP the detail in the dynamic table view. But my problem is, it will change, but the table view is empty.

BUT, if I try to show up first the dynamic table view, it will work fine...

How is that impossible?

It looks like that:

https://www.dropbox.com/s/cr6m50bqdic6yrk/Bildschirmfoto%202015-06-25%20um%2018.20.26.png?dl=0

Code from the dynamic table view:

- (void)viewDidLoad {
    [super viewDidLoad];

    self.weekdays = [NSMutableArray arrayWithObjects:@"a", @"b", @"c", @"d", @"e", @"f", @"g", nil];
}

-(void)viewDidAppear:(BOOL)animated{

}

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {

    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {

    return [self.weekdays count];
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"weekdaysCell" forIndexPath:indexPath];

    cell.textLabel.text = [self.weekdays objectAtIndex:indexPath.row];

    return cell;
}

Answers


ctrl + drag from one of the cells in section 2 (make sure only the cell is selected) to the other tableviewcontroller in the pop up choose : Show from the Selection Segue list

You should make sure that in Utilities-> identity inspector -> custom class , you have the class that implements the tableviewcontroller you use to fill up your table.

Click on the prototype cell and In the Utilities-> attributes inspector -> identifier , did you type "weekdaysCell" ?

I tested your code, it works when I name the prototype cell in the dynamictable! :)

https://www.dropbox.com/s/4oh1z160t7gdg33/Screen%20Shot%202015-06-25%20at%204.11.20%20PM.png?dl=0


Need Your Help

Apache Ant installation Windows 7

java xml apache ant build

When I do ant -version on command line, it says not recognized. Any ideas on how to fix? I'm trying to make a build.xml for a Java project.

Creating a generic next button for UITextField

ios objective-c for-loop tags uitextfield

I am trying to create a next button that works with the textField's tag.