Skip to content

Instantly share code, notes, and snippets.

@valexa
Created December 17, 2011 14:59
Show Gist options
  • Save valexa/1490434 to your computer and use it in GitHub Desktop.
Save valexa/1490434 to your computer and use it in GitHub Desktop.
changing [ret description] to ret does not work as expected
NSMutableArray *ivarPrevious = [NSMutableArray arrayWithCapacity:1];
-(void)foo
{
NSMutableArray *newivarPrevious = [NSMutableArray arrayWithCapacity:1];
for (...){
NSMutableDictionary *ret = [NSMutableDictionary dictionaryWithCapacity:1];
[ret setObject:foo forKey:@"foo"];
[ret setObject:bar forKey:@"bar"];
[newivarPrevious addObject:[ret description]];
if (![ivarPrevious containsObject:[ret description]]) {
//new
}
}
[ivarPrevious removeAllObjects];
[ivarPrevious setArray:newivarPrevious];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment