Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (void)_runSearchWithSearchString:(NSString *)searchString {
- //10-28-2011 cass: omniture notification: "search called" event10
- NSLog(@"search %@",searchString);
- NSDictionary *userInfo = [NSDictionary dictionaryWithObjectsAndKeys:searchString, @"query", nil];
- [[NSNotificationCenter defaultCenter] postNotificationName:BCSearchNotification object:nil userInfo:userInfo];
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- if ([self _isWebServiceSearch]) {
- self.searchString = searchString;
- [self _runWebServiceSearch];
- }
- else {
- NSMutableArray *tempArray = nil;
- @synchronized([BCDatabaseController sharedController]) {
- tempArray = [[BCDatabaseController sharedController] newsItemsForSearchString:searchString];
- }
- static NSSortDescriptor *sortDescriptor = nil;
- if (!sortDescriptor)
- sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"pubDate" ascending:NO selector:@selector(compare:)];
- [tempArray sortUsingDescriptors:[NSArray arrayWithObject:sortDescriptor]];
- [self performSelectorOnMainThread:@selector(_handleNewsItemsLoaded:) withObject:[[tempArray copy] autorelease] waitUntilDone:NO];
- }
- [pool release];
- }
Add Comment
Please, Sign In to add comment