Terms Flashcards

1
Q

What is a runtime instance of a class?

A

An object

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

An object contains what of the instance variables declared by its class and what to the methods of the class?

A

In-memory copy and pointers

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

What is the procedure to create an object?

A

Allocation and initialization

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

What two distinct pieces specify a class?

A

The interface and the implementation

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

Where does the class declaration and definitions for the public interface go?

A

The interface

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

Which file extension has the class, type, function and constant declarations in them?

A

The header files (.h)

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

Which file extension has the implementation in them and may contain Objective-C and C code in them?

A

The implementation files (.m)

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

Which file extension has the implementation in them and may contain Objective-C, C, and C++ code in them?

A

The implementation files (.mm)

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

What compiler directive insures that that the same file is never included more than once?

A

import

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

What file in a framework is best to import, and what is usually that filed named?

A
The framework's umbrella file and is usually the same name as framework; e.g., the syntax for importing the header files of the (hypothetical) Gizmo framework is:
#import
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

A class declaration begins and ends with what compiler directives?

A

@interface and @end

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q
What is the class name and what is the parent class name in the following syntax:
@interface ClassA : ClassB
@end
A

ClassA is the class name and ClassB is the parent class

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

True or False. An Objective-C class can have more than one parent.

A

False. In Objective-C, a class can have only one parent.

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

What are the only two types of declarations that can be in a class declaration?

A

Property and method declarations

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

Where do any class declarations of custom functions, constants, or data types go in the interface file (.h)?

A

Outside of the @interface…@end block.

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

A class implementation begins and ends with what compiler directives?

A

@implementation and @end

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

What should an implementation file always import as part of its first lines of code?

A

It’s interface file.

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

What are the two types of variables that will contain an object that are supported in Objective-C and how are they declared?

A
Static variable declarations include the class name.
Dynamic variable declarations use the type 'id' for the object.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What must go in front of all statically typed object variables and what does it represent?

A

An asterisk, which represents a pointer declaration.

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

True or False. An ‘id’ object variable type implies a pointer.

A

True.

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

What do you send to an object to call a method of that object?

A

A message

22
Q

What is another way to say that you are sending a message to an object?

A

Messaging

23
Q

What are the two types of methods in Objective-C?

A

Instance and class methods

24
Q

Which type of method is a method whose execution is scoped to a particular instance of the class?

A

Instance method

25
Q

Which type of method is a method whose execution is scoped to a method’s class?

A

Class method

26
Q

True or False. You can call an instance method before you create an instance of the class.

A

False. You must first create an instance of the class and then message that instance method through that instance.

27
Q

True or False. A class method does not require an instance of an object to be the receiver of a message.

A

True.

28
Q

Fill in the missing component of a method declaration.
The declaration of a method consists of the method type identifier, a return type, one or more what, and the parameter type and name information.

A

Signature keywords

29
Q

The minus sign (-) precedes what type of method?

A

Instance method

30
Q

The plus sign (+) precedes what type of method?

A

Class method

31
Q

What is a method’s actual name?

A

A concatenation of all the signature keywords, including colon characters.

32
Q

What does the colon characters in a method declaration declare the presence of?

A

A parameter

33
Q

True or False. If a method has no parameters, you still put a colon character after the first and only method signature keyword.

A

False. You omit the colon character for no parameters.

34
Q

Although the phrase “sending a message” is commonly used as a synonym for “calling a method,” what does the actual sending?

A

The Objective-C runtime.

35
Q

What is required of the runtime to dispatch a message?

A

A message expression

36
Q

What is used in a message expression to enclose the message?

A

Square brackets ([ and ])

37
Q

What does the first keyword just inside the leftmost bracket in message expression designate?

A

The object receiving the message or to whom the message is being sent to

38
Q

What does nesting message expressions help avoid?

A

Declaring numerous local variables to store the results from each of the message expressions

39
Q

What is notation syntax is used for invoking accessor methods?

A

Dot-notation.

40
Q

What do accessor methods get and set of an object?

A

Their state

41
Q

What is key to the an object’s encapsulation?

A

Their accessor methods

42
Q

What do accessor methods provide to all instances for accessing that state?

A

A common interface

43
Q

True or False. You cannot use a reference to a dynamically typed object (type of id) in a dot-notation expression.

A

True.

44
Q

What is required to message a class itself?

A

A class method

45
Q

What type of object is a class created by the runtime?

A

Type Class

46
Q

A factory method creates a new instance of the class or is used for accessing some piece of shared information associated with the class. What type of methods are these often used factory methods?

A

Class methods

47
Q

A property the the general sense is some data what or what by and object?

A

Encapsulated or stored

48
Q

A property is either an attribute—such as a name or a color—or a what to one or more other objects?

A

Relationship

49
Q

Accessor methods provide the what and what actions that enable users of an object access to the encapsulated properties?

A

Get and set

50
Q

True or False. A “getter” accessor method, which returns the value of a property, has the same name as the property.

A

True.

51
Q

True or False. A “setter” accessor method, which sets a new value for a property, has the same name as the property.

A

False. A “setter” accessor method has the form setPropertyName:, where the first letter of the property name is capitalized.

52
Q

What does the acronym KVC stand for and what does it do?

A

Key-value coding, which is a mechanism for accessing an object’s properties indirectly through their names.