I need to move some string comparisons into a new thread, but are not quite sure how to go about getting the results of the comparison back into my method....
is there an easy way to do this?
**I am checking potentially hundreds of strings at any giving time
here is some of the code I am using (simplified):
and the matchURL method:
I want to send the matchURL method into it's own thread. and receive the result back in the checkImageRequest method
is there an easy way to do this?
**I am checking potentially hundreds of strings at any giving time
here is some of the code I am using (simplified):
Code:
- (NSURLRequest*) checkImageRequest: (NSURLRequest*) request{
NSURL* domain = [request mainDocumentURL];
int matched = [self matchURL:[theDomain absoluteString]];
if (matched == isUserWhiteListed)
{
return request;
}
}
and the matchURL method:
Code:
- (int)matchURL:(NSString*)theURL
{
int matchResult = [sab_filterSet matchToString:urlCString];
if (matchResult == isWhiteListed)
{
return isWhiteListed;
}
}
I want to send the matchURL method into it's own thread. and receive the result back in the checkImageRequest method