Fixing crash around still visible feeds in iphone app. Caused by refactor of previous crash fix.

This commit is contained in:
Samuel Clay 2011-10-19 08:49:35 -07:00
parent 09ce9fa309
commit d80db5b50f
4 changed files with 9 additions and 170 deletions

View file

@ -321,6 +321,8 @@
[self calculateFeedLocations:NO];
}
// NSLog(@"View showing all: %d and %@", self.viewShowingAllFeeds, self.stillVisibleFeeds);
for (int s=0; s < [appDelegate.dictFoldersArray count]; s++) {
NSString *folderName = [appDelegate.dictFoldersArray objectAtIndex:s];
NSArray *activeFolderFeeds = [self.activeFeedLocations objectForKey:folderName];
@ -333,9 +335,11 @@
NSDictionary *feed = [appDelegate.dictFeeds objectForKey:feedIdStr];
int maxScore = [NewsBlurViewController computeMaxScoreForFeed:feed];
if (maxScore < intelligenceLevel &&
![self.stillVisibleFeeds objectForKey:feedIdStr]) {
[indexPaths addObject:indexPath];
if (!self.viewShowingAllFeeds ||
(self.viewShowingAllFeeds && ![self.stillVisibleFeeds objectForKey:feedIdStr])) {
if (maxScore < intelligenceLevel) {
[indexPaths addObject:indexPath];
}
}
}
}

View file

@ -60,7 +60,6 @@
FF38679B13D88EEC00F8AB3A /* NSString+HTML.m in Sources */ = {isa = PBXBuildFile; fileRef = FF38679A13D88EEC00F8AB3A /* NSString+HTML.m */; };
FF38679E13D8914A00F8AB3A /* GTMNString+HTML.m in Sources */ = {isa = PBXBuildFile; fileRef = FF38679D13D8914A00F8AB3A /* GTMNString+HTML.m */; };
FF38DB1313F2112D00251891 /* UIView+TKCategory.m in Sources */ = {isa = PBXBuildFile; fileRef = FF38DB1213F2112D00251891 /* UIView+TKCategory.m */; };
FF38DB1713F211DC00251891 /* UIImage+TKCategory.m in Sources */ = {isa = PBXBuildFile; fileRef = FF38DB1613F211DC00251891 /* UIImage+TKCategory.m */; };
FF38DB1A13F21B2C00251891 /* ABTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = FF38DB1913F21B2C00251891 /* ABTableViewCell.m */; };
FF435EDB13E9AF4A0083043F /* Base64.m in Sources */ = {isa = PBXBuildFile; fileRef = FF435EDA13E9AF4A0083043F /* Base64.m */; };
FF435EDE13E9B04E0083043F /* world.png in Resources */ = {isa = PBXBuildFile; fileRef = FF435EDD13E9B04E0083043F /* world.png */; };
@ -135,7 +134,6 @@
78095E3E128EF35400230C8E /* CFNetwork.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CFNetwork.framework; path = System/Library/Frameworks/CFNetwork.framework; sourceTree = SDKROOT; };
78095E42128EF37E00230C8E /* MobileCoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MobileCoreServices.framework; path = System/Library/Frameworks/MobileCoreServices.framework; sourceTree = SDKROOT; };
78095E44128EF37E00230C8E /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; };
78095E46128EF37F00230C8E /* libz.1.2.3.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.1.2.3.dylib; path = usr/lib/libz.1.2.3.dylib; sourceTree = SDKROOT; };
78095EC6128F30B500230C8E /* OriginalStoryViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OriginalStoryViewController.h; sourceTree = "<group>"; };
78095EC7128F30B500230C8E /* OriginalStoryViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = OriginalStoryViewController.m; sourceTree = "<group>"; };
78095EC8128F30B500230C8E /* OriginalStoryViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = OriginalStoryViewController.xib; sourceTree = "<group>"; };
@ -188,8 +186,6 @@
FF38679F13D8916E00F8AB3A /* GTMDefines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GTMDefines.h; sourceTree = "<group>"; };
FF38DB1113F2112D00251891 /* UIView+TKCategory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+TKCategory.h"; sourceTree = "<group>"; };
FF38DB1213F2112D00251891 /* UIView+TKCategory.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIView+TKCategory.m"; sourceTree = "<group>"; };
FF38DB1513F211DC00251891 /* UIImage+TKCategory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIImage+TKCategory.h"; sourceTree = "<group>"; };
FF38DB1613F211DC00251891 /* UIImage+TKCategory.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIImage+TKCategory.m"; sourceTree = "<group>"; };
FF38DB1813F21B2C00251891 /* ABTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ABTableViewCell.h; sourceTree = "<group>"; };
FF38DB1913F21B2C00251891 /* ABTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ABTableViewCell.m; sourceTree = "<group>"; };
FF435ED913E9AF4A0083043F /* Base64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Base64.h; sourceTree = "<group>"; };
@ -311,7 +307,6 @@
29B97314FDCFA39411CA2CEA /* CustomTemplate */ = {
isa = PBXGroup;
children = (
FFAD4970144A386100BA6919 /* libz.dylib */,
080E96DDFE201D6D7F000001 /* Classes */,
29B97315FDCFA39411CA2CEA /* Other Sources */,
29B97317FDCFA39411CA2CEA /* Resources */,
@ -325,11 +320,11 @@
isa = PBXGroup;
children = (
32CA4F630368D1EE00C91783 /* NewsBlur_Prefix.pch */,
29B97316FDCFA39411CA2CEA /* main.m */,
FFD2BB891401AD85004277DA /* TestFlight.h */,
FFD2BB8A1401AD85004277DA /* libTestFlight.a */,
FF79E11B13EB756A0095C852 /* PullToRefreshView.h */,
FF79E11C13EB756A0095C852 /* PullToRefreshView.m */,
29B97316FDCFA39411CA2CEA /* main.m */,
FF38679913D88EEC00F8AB3A /* NSString+HTML.h */,
FF38679C13D8914A00F8AB3A /* GTMNString+HTML.h */,
FF38679F13D8916E00F8AB3A /* GTMDefines.h */,
@ -341,8 +336,6 @@
FF435EDA13E9AF4A0083043F /* Base64.m */,
FF38DB1113F2112D00251891 /* UIView+TKCategory.h */,
FF38DB1213F2112D00251891 /* UIView+TKCategory.m */,
FF38DB1513F211DC00251891 /* UIImage+TKCategory.h */,
FF38DB1613F211DC00251891 /* UIImage+TKCategory.m */,
FF38DB1813F21B2C00251891 /* ABTableViewCell.h */,
FF38DB1913F21B2C00251891 /* ABTableViewCell.m */,
FF4BBC1C13F7487A001EBEBD /* TransparentToolbar.h */,
@ -400,10 +393,10 @@
29B97323FDCFA39411CA2CEA /* Frameworks */ = {
isa = PBXGroup;
children = (
FFAD4970144A386100BA6919 /* libz.dylib */,
78095E3E128EF35400230C8E /* CFNetwork.framework */,
78095E42128EF37E00230C8E /* MobileCoreServices.framework */,
78095E44128EF37E00230C8E /* SystemConfiguration.framework */,
78095E46128EF37F00230C8E /* libz.1.2.3.dylib */,
78095E3A128EF32200230C8E /* Reachability */,
78095E23128EF30C00230C8E /* ASI */,
78FC34E911CA94900055C312 /* JSON */,
@ -611,7 +604,6 @@
FF793E1B13F1A9F700F282D2 /* ASIDataCompressor.m in Sources */,
FF793E1C13F1A9F700F282D2 /* ASIDataDecompressor.m in Sources */,
FF38DB1313F2112D00251891 /* UIView+TKCategory.m in Sources */,
FF38DB1713F211DC00251891 /* UIImage+TKCategory.m in Sources */,
FF38DB1A13F21B2C00251891 /* ABTableViewCell.m in Sources */,
FF4BBC1E13F7487A001EBEBD /* TransparentToolbar.m in Sources */,
FF56EC7B13F755E40009D8E0 /* MBProgressHUD.m in Sources */,

View file

@ -1,49 +0,0 @@
//
// UIImageAdditions.h
// Created by Devin Ross on 7/25/09.
//
/*
tapku.com || http://github.com/devinross/tapkulibrary
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
*/
#import <UIKit/UIKit.h>
@interface UIImage (TKCategory)
- (UIImage *) imageCroppedToRect:(CGRect)rect;
- (UIImage *) squareImage;
- (void) drawInRect:(CGRect)rect withImageMask:(UIImage*)mask;
- (void) drawMaskedColorInRect:(CGRect)rect withColor:(UIColor*)color;
- (void) drawMaskedGradientInRect:(CGRect)rect withColors:(NSArray*)colors;
@end

View file

@ -1,108 +0,0 @@
//
// UIImageAdditions.m
// Created by Devin Ross on 7/25/09.
//
/*
tapku.com || http://github.com/devinross/tapkulibrary
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
*/
#import "UIImage+TKCategory.h"
#import "UIView+TKCategory.h"
@implementation UIImage (TKCategory)
- (UIImage *) imageCroppedToRect:(CGRect)rect{
CGImageRef imageRef = CGImageCreateWithImageInRect([self CGImage], rect);
UIImage *cropped = [UIImage imageWithCGImage:imageRef];
CGImageRelease(imageRef);
return cropped; // autoreleased
}
- (UIImage *) squareImage{
CGFloat shortestSide = self.size.width <= self.size.height ? self.size.width : self.size.height;
return [self imageCroppedToRect:CGRectMake(0.0, 0.0, shortestSide, shortestSide)];
}
- (void) drawInRect:(CGRect)rect withImageMask:(UIImage*)mask{
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSaveGState(context);
CGContextTranslateCTM(context, 0.0, rect.size.height);
CGContextScaleCTM(context, 1.0, -1.0);
rect.origin.y = rect.origin.y * -1;
CGContextClipToMask(context, rect, mask.CGImage);
//CGContextSetRGBFillColor(context, color[0], color[1], color[2], color[3]);
//CGContextFillRect(context, rect);
CGContextDrawImage(context,rect,self.CGImage);
CGContextRestoreGState(context);
}
- (void) drawMaskedColorInRect:(CGRect)rect withColor:(UIColor*)color{
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSaveGState(context);
CGContextSetFillColorWithColor(context, color.CGColor);
CGContextTranslateCTM(context, 0.0, rect.size.height);
CGContextScaleCTM(context, 1.0, -1.0);
rect.origin.y = rect.origin.y * -1;
CGContextClipToMask(context, rect, self.CGImage);
CGContextFillRect(context, rect);
CGContextRestoreGState(context);
}
- (void) drawMaskedGradientInRect:(CGRect)rect withColors:(NSArray*)colors{
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSaveGState(context);
CGContextTranslateCTM(context, 0.0, rect.size.height);
CGContextScaleCTM(context, 1.0, -1.0);
rect.origin.y = rect.origin.y * -1;
CGContextClipToMask(context, rect, self.CGImage);
[UIView drawGradientInRect:rect withColors:colors];
CGContextRestoreGState(context);
}
@end