Random Questions Flashcards

1
Q

Selector

A

A selector in Objective-C is essentially a C data struct that serves as a mean to identify an Objective-C method you want an object to perform.

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

Swizzling

A

To swizzle a method is to change a class’s dispatch table in order to resolve messages from an existing selector to a different implementation, while aliasing the original method implementation to a new selector.

Swizzling should always be done in +load.

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

What are the two methods invoked in Objective-C runtime?

A

There are two methods that are automatically invoked by the Objective-C runtime for each class. +load is sent when the class is initially loaded, while +initialize is called just before the application calls its first method on that class or an instance of that class. Both are optional, and are executed only if the method is implemented.

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