Created
October 28, 2011 18:38
-
-
Save projectxcappe/1323022 to your computer and use it in GitHub Desktop.
analytics...
This file contains hidden or 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)_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]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment