Terms Flashcards

(52 cards)

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?

22
Q

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

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
Which type of method is a method whose execution is scoped to a method's class?
Class method
26
True or False. You can call an instance method before you create an instance of the class.
False. You must first create an instance of the class and then message that instance method through that instance.
27
True or False. A class method does not require an instance of an object to be the receiver of a message.
True.
28
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.
Signature keywords
29
The minus sign (-) precedes what type of method?
Instance method
30
The plus sign (+) precedes what type of method?
Class method
31
What is a method's actual name?
A concatenation of all the signature keywords, including colon characters.
32
What does the colon characters in a method declaration declare the presence of?
A parameter
33
True or False. If a method has no parameters, you still put a colon character after the first and only method signature keyword.
False. You omit the colon character for no parameters.
34
Although the phrase "sending a message" is commonly used as a synonym for "calling a method," what does the actual sending?
The Objective-C runtime.
35
What is required of the runtime to dispatch a message?
A message expression
36
What is used in a message expression to enclose the message?
Square brackets ([ and ])
37
What does the first keyword just inside the leftmost bracket in message expression designate?
The object receiving the message or to whom the message is being sent to
38
What does nesting message expressions help avoid?
Declaring numerous local variables to store the results from each of the message expressions
39
What is notation syntax is used for invoking accessor methods?
Dot-notation.
40
What do accessor methods get and set of an object?
Their state
41
What is key to the an object's encapsulation?
Their accessor methods
42
What do accessor methods provide to all instances for accessing that state?
A common interface
43
True or False. You cannot use a reference to a dynamically typed object (type of id) in a dot-notation expression.
True.
44
What is required to message a class itself?
A class method
45
What type of object is a class created by the runtime?
Type Class
46
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?
Class methods
47
A property the the general sense is some data what or what by and object?
Encapsulated or stored
48
A property is either an attribute—such as a name or a color—or a what to one or more other objects?
Relationship
49
Accessor methods provide the what and what actions that enable users of an object access to the encapsulated properties?
Get and set
50
True or False. A "getter" accessor method, which returns the value of a property, has the same name as the property.
True.
51
True or False. A "setter" accessor method, which sets a new value for a property, has the same name as the property.
False. A "setter" accessor method has the form setPropertyName:, where the first letter of the property name is capitalized.
52
What does the acronym KVC stand for and what does it do?
Key-value coding, which is a mechanism for accessing an object's properties indirectly through their names.