Fixing a couple crashing bugs.

This commit is contained in:
Samuel Clay 2013-10-01 19:32:40 -07:00
parent 932eaa3d15
commit f1bd549b9f
3 changed files with 15 additions and 4 deletions

View file

@ -159,7 +159,7 @@ static UIFont *indicatorFont = nil;
// story title
CGSize theSize = [cell.storyTitle
boundingRectWithSize:CGSizeMake(rect.size.width, 30.0)
boundingRectWithSize:CGSizeMake(rect.size.width, cell.isShort ? 15.0 : 30.0)
options:NSStringDrawingTruncatesLastVisibleLine|NSStringDrawingUsesLineFragmentOrigin
attributes:@{NSFontAttributeName: font,
NSParagraphStyleAttributeName: paragraphStyle}

View file

@ -641,7 +641,7 @@
for (id key in [newClassifiers allKeys]) {
[appDelegate.activeClassifiers setObject:[newClassifiers objectForKey:key] forKey:key];
}
} else {
} else if (newClassifiers) {
[appDelegate.activeClassifiers setObject:newClassifiers forKey:feedIdStr];
}
appDelegate.activePopularAuthors = [results objectForKey:@"feed_authors"];
@ -1514,7 +1514,15 @@
}
- (void)finishMarkAsUnread:(ASIFormDataRequest *)request {
if ([request responseStatusCode] != 200) {
NSString *responseString = [request responseString];
NSData *responseData = [responseString dataUsingEncoding:NSUTF8StringEncoding];
NSError *error;
NSDictionary *results = [NSJSONSerialization
JSONObjectWithData:responseData
options:kNilOptions
error:&error];
if ([request responseStatusCode] != 200 || [[results objectForKey:@"code"] integerValue] < 0) {
return [self failedMarkAsUnread:request];
}
@ -1523,7 +1531,8 @@
- (void)failedMarkAsUnread:(ASIFormDataRequest *)request {
[self informError:@"Failed to unread story"];
// [appDelegate markStory:request.userInfo asRead:YES];
[appDelegate markStoryRead:[request.userInfo objectForKey:@"story_hash"]
feedId:[request.userInfo objectForKey:@"story_feed_id"]];
[self.storyTitlesTable reloadData];
}

View file

@ -883,6 +883,8 @@ static const CGFloat kFolderTitleHeight = 28.0f;
cell.negativeCount = [[unreadCounts objectForKey:@"ng"] intValue];
cell.isSocial = isSocial;
[cell setNeedsDisplay];
return cell;
}