配列に文字列オブジェクトを入力しています。これらは何千もある可能性があります。私はforループ内で多くの割り当てと初期化を行っていますが、これは高価であることがわかっています。これを行うためのより良い、より効率的な方法は何ですか?
ありがとう
//loop through the array of dictionaries
for(NSUInteger i =0; i < [latestResults count]; i++){
self.workingEntry = [[AppRecord alloc] init];
//Get the next dictionary from the array of dictionaries
NSDictionary *currentRecord = [latestResults objectAtIndex:i];
//Set the object
[self.workingEntry setAppURLString:[currentRecord valueForKeyPath:@"id.label"]];
[self.workingEntry setAppName:[currentRecord valueForKeyPath:@"im:name.label"]];
NSArray *imageArray = [currentRecord valueForKeyPath:@"im:image.label"];
[self.workingEntry setImageURLString:[imageArray objectAtIndex:0]];
[self.workingEntry setArtist:[currentRecord valueForKeyPath:@"im:artist.label"]];
//Add object to array
[self.workingArray addObject:self.workingEntry];
currentRecord = nil;
self.workingEntry = nil;
imageArray = nil;
}