Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated on 9/9/2015 -AN #23

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions objc-speaking-grandma/FISAppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -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.
}

Expand Down