Created
June 26, 2011 23:23
-
-
Save nheagy/1048093 to your computer and use it in GitHub Desktop.
Analyzer thinks I'm leaking args, which obviously I am
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-(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