Ich muss den Inhalt eines NSArray in NSMutable-Array kopieren. Mit anderen Worten, ich möchte arrayCountryChoices nach arraySearchResults kopieren. Irgendwelche Ideen????iPhone SDK: Wie kopiert man den Inhalt eines NSArray in ein NSMutable-Array?
//main data
NSArray *arrayCountryChoices;
//search results buffer
NSMutableArray *arraySearchResults;
//create data
arrayCountryChoices = [[NSArray alloc] initWithObjects:@"foo",@"bar",@"baz",nil];
//copy the original array to searchable array ->> THIS IS NOT WORKING AS EXPECTED
arraySearchResults = [[NSMutableArray alloc] arrayWithArray:arrayCountryChoices];
Vielen Dank im Voraus.
// Das ursprüngliche Array in das durchsuchbare Array kopieren \t arraySearchResults = [[NSMutableArray alloc] initWithArray: arrayCountryChoices]; Arbeitete wie ein Champion. Vielen Dank. – user265550
Gern geschehen. –
Welche davon ist effizienter? – FreeAsInBeer