From c6fe5608bdb97fdb5f079a2d0471ef2a2b7af35f Mon Sep 17 00:00:00 2001 From: newyork-anthonyng Date: Wed, 9 Sep 2015 10:50:44 -0400 Subject: [PATCH] Updated on 9/9/2015 -AN --- objc-speaking-grandma/FISAppDelegate.m | 38 ++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/objc-speaking-grandma/FISAppDelegate.m b/objc-speaking-grandma/FISAppDelegate.m index 13dce12..1ed2d46 100644 --- a/objc-speaking-grandma/FISAppDelegate.m +++ b/objc-speaking-grandma/FISAppDelegate.m @@ -24,6 +24,44 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:( */ + + // CODE-ALONG I: TALK TO GRANDMA + 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'S THAT? SPEAK UP, DEAR!"); + } + + // CODE-ALONG II: DIRECT EVALUATION + if([talkToGrandma isEqualToString:shoutAtGrandma]) { + NSLog(@"NO, NOT SINCE 1938!"); + } else { + NSLog(@"WHAT'S THAT? SPEAK UP, DEAR!"); + } + + // CODE-ALONG III: INVERTED CHECK + if(!shouting) { + NSLog(@"WHAT'S THAT? SPEAK UP, DEAR!"); + } else { + NSLog(@"NO, NOT SINCE 1938!"); + } + + if(![talkToGrandma isEqualToString:shoutAtGrandma]) { + NSLog(@"WHAT'S THAT? SPEAK UP, DEAR!"); + } else { + NSLog(@"NO, NOT SINCE 1938!"); + } + + + + return YES; // Don't alter this statement. }