iOS v7.0.1. Fixing crash with saved story tags.

This commit is contained in:
Samuel Clay 2017-07-27 17:14:28 -07:00
parent 3bcfba0a9b
commit 02584d57ed
2 changed files with 25 additions and 13 deletions

View file

@ -319,18 +319,30 @@ const NSInteger kHeaderHeight = 24;
- (void)searchBarSearchButtonClicked:(UISearchBar *)searchBar {
[addTagBar resignFirstResponder];
NSString *tagName = addTagBar.text;
NSMutableDictionary *story = [appDelegate.activeStory mutableCopy];
[story setObject:[[story objectForKey:@"user_tags"] arrayByAddingObject:tagName] forKey:@"user_tags"];
[appDelegate.storiesCollection markStory:story asSaved:YES forceUpdate:YES];
[appDelegate.storiesCollection syncStoryAsSaved:story];
[appDelegate adjustSavedStoryCount:tagName direction:1];
NSInteger row = [[self arrayUserTags] indexOfObject:tagName];
[tagsTableView beginUpdates];
[tagsTableView insertRowsAtIndexPaths:@[[NSIndexPath indexPathForRow:row inSection:0]]
withRowAnimation:UITableViewRowAnimationTop];
[tagsTableView endUpdates];
if ([[self arrayStoryTags] containsObject:tagName]) {
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:[self.arrayStoryTags indexOfObject:tagName] inSection:1];
[self tableView:tagsTableView didSelectRowAtIndexPath:indexPath];
} else if ([[self arrayUserTags] containsObject:tagName]) {
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:[self.arrayUserTags indexOfObject:tagName] inSection:0];
[self tableView:tagsTableView didSelectRowAtIndexPath:indexPath];
} else if ([[self arrayUserTagsNotInStory] containsObject:tagName]) {
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:[self.arrayUserTagsNotInStory indexOfObject:tagName] inSection:2];
[self tableView:tagsTableView didSelectRowAtIndexPath:indexPath];
} else {
NSMutableDictionary *story = [appDelegate.activeStory mutableCopy];
[story setObject:[[story objectForKey:@"user_tags"] arrayByAddingObject:tagName] forKey:@"user_tags"];
[appDelegate.storiesCollection markStory:story asSaved:YES forceUpdate:YES];
[appDelegate.storiesCollection syncStoryAsSaved:story];
[appDelegate adjustSavedStoryCount:tagName direction:1];
NSInteger row = [[self arrayUserTags] indexOfObject:tagName];
[tagsTableView beginUpdates];
[tagsTableView insertRowsAtIndexPaths:@[[NSIndexPath indexPathForRow:row inSection:0]]
withRowAnimation:UITableViewRowAnimationTop];
[tagsTableView endUpdates];
}
[addTagBar setText:@""];
}

View file

@ -19,7 +19,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>7.0.0</string>
<string>7.0.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
@ -58,7 +58,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>78</string>
<string>79</string>
<key>FacebookAppID</key>
<string>230426707030569</string>
<key>ITSAppUsesNonExemptEncryption</key>