Last active
March 15, 2016 20:39
-
-
Save kidap/145e39382a4ac8e60a8b to your computer and use it in GitHub Desktop.
W1E Readings & Questions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Q1 Explain the different components of MVC - what are their responsibilities? | |
- Model - data source/holder | |
- View - all the UI elements | |
- Controller - displays the view and handles all the interaction between the model and view | |
Q2 What are some benefits of having an NSObject protocol separate from the NSObject class? | |
- When delegates conform to the NSObject protocol, the delegates will inherit the retain and release methods. Also, all the objects that will conform to the protocol are required to conform to NSObject protocol | |
- | |
Q3 Given the following person class, create a subclass LLShoutingPerson whose designated initializer is initWithLoudMessage:. Write the implementation for LLShoutingPerson's initializer. | |
@interface LLShoutingPerson : LLPerson | |
-(instancetype)initWithLoudMessage:(NSString *)msg; | |
@end | |
@implementation LLShoutingPerson : LLPerson | |
-(instancetype)initWithLoudMessage:(NSString *)msg{ | |
if (self = [super initWithMessage:[NSString stringWithFormat:@"%@!!!!",msg]]){ | |
} | |
return self; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment