Objective-C Basics Flashcards

1
Q

Interpolate Most Basic

A

(@”%@”, @”Ari”);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Interpolate Most Basic Print To Command Line

A

NSLog(@”%@”, @”Ari”);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

primatives

A

NSInteger
NSUInteger
CGFloat
BOOL

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

primitives vs objects

A

objects hold values and can change them through behaviors called “methods”, while primitives just hold a value.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

NSUInteger

A

An integer value that can only be zero or positive (the “U” means “unsigned”).
0,1,2,3,4

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

NSInteger Format Specifier

A

%li

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

NSUInteger Format Specifier

A

%lu

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

CGFloat Format Specifier

A

%f or %.nf, where n is the number of decimal places to display

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

BOOL Format Specifier

A

%d

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Help -> Documentation and API Reference

A

⇧⌘0

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

what is “calling a method”

A

its simply using a method [object method]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

standard method call syntax

A

ReturnType *captureVariable = [recipientObject methodNameArgument:argumentVariable];

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

multiple method call syntax example

A

NSString *shorthandWelcome = [welcome stringByReplacingOccurrencesOfString:stringToReplace withString:replacementString];

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

has prefix has suffix example

A

NSString *lafayette =
@”Marquis Marie-Joseph Paul Yves Roch Gilbert du Motier de Lafayette”;

BOOL isMarquis = [lafayette hasPrefix:@”Marquis”];
BOOL isLafayette = [lafayette hasSuffix:@”Lafayette”];

if (isMarquis && isLafayette) {
NSLog(@”Ladies and gentlemen, the Marquis de Lafayette”);
}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

stringByAppendingString Example

A

NSString *welcome = @”Welcome to “;
welcome = [welcome stringByAppendingString:@”the Flatiron School!”];

NSLog(@”%@”, welcome);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly