From 8423877f28f035b991be913ef30a0117e8ca8143 Mon Sep 17 00:00:00 2001 From: David Sklenar Date: Fri, 18 Oct 2013 13:37:51 -0700 Subject: [PATCH 1/4] Remove deprecated view controller presentation code. --- mailcomp.m | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mailcomp.m b/mailcomp.m index bab0dc52..84cd40c8 100644 --- a/mailcomp.m +++ b/mailcomp.m @@ -16,7 +16,7 @@ - (void)presentModalMailComposerViewController:(BOOL)animated { [composeViewController setMessageBody:<#Body#> isHTML:YES]; [composeViewController setToRecipients:@[<#Recipients#>]]; - [self presentModalViewController:composeViewController animated:animated]; + [self presentViewController:composeViewController animated:animated completion:nil]; } else { [[[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Error", nil) message:NSLocalizedString(@"<#Cannot Send Mail Message#>", nil) delegate:nil cancelButtonTitle:NSLocalizedString(@"OK", nil) otherButtonTitles:nil] show]; } @@ -31,8 +31,7 @@ - (void)mailComposeController:(MFMailComposeViewController *)controller if (error) { NSLog(@"%@", error); - <#statements#> } - [self dismissModalViewControllerAnimated:YES]; + [self dismissViewControllerAnimated:YES completion:nil]; } From 5e96e2230ee473035bb8cc27c809c3d719ab5e19 Mon Sep 17 00:00:00 2001 From: David Sklenar Date: Fri, 18 Oct 2013 13:42:00 -0700 Subject: [PATCH 2/4] Modernize library searching a bit. --- library.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library.m b/library.m index 1f50f6c2..b027462c 100644 --- a/library.m +++ b/library.m @@ -5,4 +5,4 @@ // Completion Scope: Function or Method NSArray *librarySearchPaths = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES); -NSString *libraryDirectory = [librarySearchPaths count] == 0 ? nil : [librarySearchPaths objectAtIndex:0]; +NSString *libraryDirectory = [librarySearchPaths firstObject]; From 72d6d49d37367555ce4b7822b5bc1a3093a8e780 Mon Sep 17 00:00:00 2001 From: David Sklenar Date: Fri, 18 Oct 2013 13:46:10 -0700 Subject: [PATCH 3/4] Use array literals. --- frcd.m | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/frcd.m b/frcd.m index 0e8b1440..4fadf9e2 100644 --- a/frcd.m +++ b/frcd.m @@ -27,24 +27,24 @@ - (void)controller:(NSFetchedResultsController *)controller } - (void)controller:(NSFetchedResultsController *)controller - didChangeObject:(id)object - atIndexPath:(NSIndexPath *)indexPath - forChangeType:(NSFetchedResultsChangeType)type - newIndexPath:(NSIndexPath *)newIndexPath -{ +didChangeObject:(id)object +atIndexPath:(NSIndexPath *)indexPath +forChangeType:(NSFetchedResultsChangeType)type +newIndexPath:(NSIndexPath *)newIndexPath +{ switch(type) { case NSFetchedResultsChangeInsert: - [self.tableView insertRowsAtIndexPaths:[NSArray arrayWithObject:newIndexPath] withRowAnimation:UITableViewRowAnimationAutomatic]; + [self.tableView insertRowsAtIndexPaths:@[newIndexPath] withRowAnimation:UITableViewRowAnimationAutomatic]; break; case NSFetchedResultsChangeDelete: - [self.tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationAutomatic]; + [self.tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationAutomatic]; break; case NSFetchedResultsChangeUpdate: [self configureCell:[self.tableView cellForRowAtIndexPath:indexPath] forRowAtIndexPath:indexPath]; break; case NSFetchedResultsChangeMove: - [self.tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationAutomatic]; - [self.tableView insertRowsAtIndexPaths:[NSArray arrayWithObject:newIndexPath] withRowAnimation:UITableViewRowAnimationAutomatic]; + [self.tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationAutomatic]; + [self.tableView insertRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationAutomatic]; break; } } From 3fb94d45ab704689eca0e4ba87489a36fef24170 Mon Sep 17 00:00:00 2001 From: David Sklenar Date: Wed, 13 Nov 2013 13:30:17 -0800 Subject: [PATCH 4/4] Fix indents. --- frcd.m | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/frcd.m b/frcd.m index 4fadf9e2..b7d6c0e0 100644 --- a/frcd.m +++ b/frcd.m @@ -27,10 +27,10 @@ - (void)controller:(NSFetchedResultsController *)controller } - (void)controller:(NSFetchedResultsController *)controller -didChangeObject:(id)object -atIndexPath:(NSIndexPath *)indexPath -forChangeType:(NSFetchedResultsChangeType)type -newIndexPath:(NSIndexPath *)newIndexPath + didChangeObject:(id)object + atIndexPath:(NSIndexPath *)indexPath + forChangeType:(NSFetchedResultsChangeType)type + newIndexPath:(NSIndexPath *)newIndexPath { switch(type) { case NSFetchedResultsChangeInsert: @@ -51,4 +51,4 @@ - (void)controller:(NSFetchedResultsController *)controller - (void)controllerDidChangeContent:(NSFetchedResultsController *)controller { [self.tableView endUpdates]; -} +} \ No newline at end of file