Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (id)tableView:(NSTableView *)tableView objectValueForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)rowIndex
- {
- if (tableView == tableShowingByNetworkPages) {
- NSInteger totalLinksSoFarAcrossAllPages = 0;
- NSInteger linksCountInPage;
- id identifier;
- identifier = [tableColumn identifier];
- NSString *currentPageKey;
- for (currentPageKey in [self dictionaryOfAllOnSitePages])
- {
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc]init];
- NetworkPage *currentPage = [[self dictionaryOfAllOnSitePages]valueForKey:currentPageKey];
- NSSet *linksSetInCurrentPage = [[NSSet alloc]initWithArray:[currentPage arrayOfAllLinksOnPage]];
- if ([self showOnlyBadLinks] == NSOnState) {
- NSPredicate *predicate = [NSPredicate predicateWithFormat:@"statusCode != 200"];
- linksSetInCurrentPage = [linksSetInCurrentPage filteredSetUsingPredicate:predicate];
- }
- linksCountInPage = [linksSetInCurrentPage count];
- if (rowIndex < totalLinksSoFarAcrossAllPages + linksCountInPage)
- {
- if ([identifier isEqual:@"page"])
- {
- NSString *stringToReturn = [NSString stringWithFormat:@"%@\n%@", [currentPage pageTitle], [currentPage pageURL]];
- [linksSetInCurrentPage release];
- return stringToReturn;
- }
- else {
- NSArray *linksInPage = [[NSArray alloc]initWithArray:[linksSetInCurrentPage allObjects]];
- [linksSetInCurrentPage release];
- NetworkLink *currentLink = [linksInPage objectAtIndex:rowIndex - totalLinksSoFarAcrossAllPages];
- [linksInPage release];
- if ([identifier isEqual:@"status"])
- {
- return currentLink;
- }
- else if ([identifier isEqual:@"link"])
- {
- return [currentLink link];
- }
- }
- }
- else {
- [linksSetInCurrentPage release];
- totalLinksSoFarAcrossAllPages += linksCountInPage;
- [pool release];
- continue;
- }
- }
- return nil;
- }
- return nil;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement