Mehrere UITableview in Einzel-Viewcontroller

Ich habe eine viewcontroller dass ich zeigen möchte, 3 tableviews(weil der Inhalt und die Eigenschaften einer Tabelle sind verschiedene). Wie füge ich diese delegate-Methoden für die 3 Tabellen in eine viewcontroller?

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return [array1 count];
}

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

BEARBEITEN

Also, was mache ich, wenn ich will hinzufügen, ein uislider auf eine Zeile in der Tabelle mit benutzerdefinierten cell und wenn ich schieben Sie den Wert möchte ich zum ändern der display-Helligkeit?

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    if (tableView == _displayThemes) {
        return 1;
    } else {
        return 1; 
    }
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    if(tableView==_displayThemes) {
        return 1;
    } else {
        return 5;
    }
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    static NSString *CellIdentifier = @"Cell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];

    if (!cell) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
    }

    if (tableView == _displayThemes) {
        cell.textLabel.text = [displaytheme objectAtIndex:indexPath.row];
        return cell;
    } else {
        cell.textLabel.text = [fontlist objectAtIndex:indexPath.row];
        return cell;
    }
}


- (IBAction)fontButton:(id)sender {
    _fontList = [[UITableView alloc]init];
    [self.view addSubview:_fontList];
    [UIView animateWithDuration:1.5
            delay:0
            options: UIViewAnimationOptionTransitionCurlUp
            animations:^{
                _fontList.fram e= CGRectMake(0,800,320,200);
            }
            completion:^(BOOL finished){
                _fontList.frame = CGRectMake(0,280,320,200);     
    }];

    [_fontList reloadData];
}

- (IBAction)button:(id)sender {
    _displayThemes = [[UITableView alloc]init];
    [self.view addSubview:_displayThemes];
    [UIView animateWithDuration:1.5
            delay:0
            options: UIViewAnimationOptionTransitionCurlUp
            animations:^{
                _displayThemes.frame=CGRectMake(0,800,320,200);
            }
            completion:^(BOOL finished){
                _displayThemes.frame=CGRectMake(0,280,320,200);
    }];
}

InformationsquelleAutor Naveen | 2013-04-24

Schreibe einen Kommentar