Kopieren NSMutablearray zu einem anderen

Ich bin versucht zu kopieren NSMutableArray zur anderen, aber es nicht zeigen Sie mir etwas auf die UITableView:

NSMutableArray *objectsToAdd= [[NSMutableArray alloc] initWithObjects:@"one",@"two"];

NSMutableArray *myArray = [[NSMutableArray alloc] initWithObjects:objectsToAdd,nil];

NSMutableArray *list = [[NSMutableArray alloc] init];

[self.list addObjectsFromArray:myArray];

Nichts auftauchen! Was ist falsch?

Stürzt meine app, weil ich nicht über null-bei meinem NSMutableArray wie kann ich nil? addobject:nil funktioniert nicht, es stürzt die app:

static NSString * DisclosureButtonCellIdentifier = 
@"DisclosureButtonCellIdentifier";

UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier: 
                         DisclosureButtonCellIdentifier];
if (cell == nil) {
    cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault 
                                   reuseIdentifier: DisclosureButtonCellIdentifier]
            autorelease];
}
NSUInteger row = [indexPath row];

NSString *rowString =nil;

rowString = [list objectAtIndex:row];


cell.textLabel.text = rowString;

cell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton;
[rowString release];
return cell;
warum etwas angezeigt werden soll? posten Sie Ihre cellForRowAtIndexPath: Methode code
Update wie kann ich nil zu NSMutableArray mit addObject? Es stürzt mein app auf cellForRowAtIndexPath

InformationsquelleAutor stefanosn | 2010-01-13

Schreibe einen Kommentar