From e887af2f6d77d1dcfcb82aa6397160c117dfc3e4 Mon Sep 17 00:00:00 2001 From: Buntry Date: Tue, 4 Aug 2015 22:40:09 -0400 Subject: [PATCH] completed lab --- objc-speaking-grandma/FISAppDelegate.m | 36 ++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 5 deletions(-) diff --git a/objc-speaking-grandma/FISAppDelegate.m b/objc-speaking-grandma/FISAppDelegate.m index 13dce12..3571623 100644 --- a/objc-speaking-grandma/FISAppDelegate.m +++ b/objc-speaking-grandma/FISAppDelegate.m @@ -18,11 +18,37 @@ @implementation FISAppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Override point for customization after application launch. - /** - - * Write your code here! - - */ + NSString *talkToGrandma = @"HI, GRANDMA!"; + NSString *shoutAtGrandma = [talkToGrandma uppercaseString]; + BOOL shouting = [talkToGrandma isEqualToString:shoutAtGrandma]; + + talkToGrandma = @"Hi, Grandma!"; + shoutAtGrandma = [talkToGrandma uppercaseString]; + + if (shouting){ + NSLog(@"NO, NOT SINCE 1938"); + } else { + NSLog(@"WHAT, SPEAK UP SONNY!"); + } + + if ([talkToGrandma isEqualToString:shoutAtGrandma]){ + NSLog(@"NO, NOT SINCE 1938"); + } else { + NSLog(@"WHAT, SPEAK UP SONNY!"); + } + + if (!shouting){ + NSLog(@"NO, NOT SINCE 1938"); + } else { + NSLog(@"WHAT, SPEAK UP SONNY!"); + } + + if (![talkToGrandma isEqualToString:shoutAtGrandma]){ + NSLog(@"NO, NOT SINCE 1938"); + } else { + NSLog(@"WHAT, SPEAK UP SONNY!"); + } + return YES; // Don't alter this statement. }