Benutzerdefinierte Zelle aus der Feder UITableView

Ich habe versucht, verschiedene Methoden, aber ohne Erfolg zu ändern, den folgenden code...

Habe ich eine nib-Datei, die funktioniert einwandfrei, wenn ich alle Zellen in diesem, aber ich will nur einen der switch-Anweisungen, um die benutzerdefinierte Zelle nib-Datei. Irgendwelche Ideen?

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

    NSUInteger row = [indexPath row];
    NSInteger section = [indexPath section];
    UITableViewCell *cell;


    switch (section) 
    {
        case 0:

            cell = [tableView dequeueReusableCellWithIdentifier:@"any-cell"];
            cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:@"any-cell"] autorelease];
            cell.text =  [showTimes objectAtIndex:row];
            break;
        case 1:

            cell = [tableView dequeueReusableCellWithIdentifier:@"any-cell"];
            cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:@"any-cell"] autorelease];
            cell.text =  [showTimes objectAtIndex:row];
            break;
        default:
            cell = [tableView dequeueReusableCellWithIdentifier:@"any-cell"];
            cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:@"any-cell"] autorelease];
            cell.text =  [showTimes objectAtIndex:row];
            break;
    }




    return cell;

}

InformationsquelleAutor Lee Armstrong | 2009-07-23

Schreibe einen Kommentar