Skip to content

Instantly share code, notes, and snippets.

@nheagy
Created June 26, 2011 23:23
Show Gist options
  • Save nheagy/1048093 to your computer and use it in GitHub Desktop.
Save nheagy/1048093 to your computer and use it in GitHub Desktop.
Analyzer thinks I'm leaking args, which obviously I am
-(void) asyncSearchFor:(NSString *)searchTerm toCount:(int)maxCount
{
if (searchTerm == nil)
{
searchTerm = @"";
}
NSArray *args = [[NSArray alloc] initWithObjects:searchTerm, [NSNumber numberWithBool:NO], [NSNumber numberWithInt:maxCount], nil];
[self performSelectorInBackground:@selector(searchForPrep:) withObject:args];
}
- (void) searchForPrep:(NSArray *)args
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSString *word = (NSString *)[args objectAtIndex:0];
NSNumber *isRepeated = (NSNumber *)[args objectAtIndex:1];
NSNumber *maxCount = (NSNumber *)[args objectAtIndex:2];
[self searchFor:word asRepeated:[isRepeated boolValue] toCount:[maxCount intValue]];
[pool drain];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment