SUBJECTS
|
BROWSE
|
CAREER CENTER
|
POPULAR
|
JOIN
|
LOGIN
Business Skills
|
Soft Skills
|
Basic Literacy
|
Certifications
About
|
Help
|
Privacy
|
Terms
|
Email
Search
Test your basic knowledge |
iOS 5 App Development 2
Start Test
Study First
Subjects
:
it-skills
,
apple
Instructions:
Answer 50 questions in 15 minutes.
If you are not ready to take this test, you can
study here
.
Match each statement with the correct term.
Don't refresh. All questions and answers are randomly picked and ordered every time you load a test.
This is a study tool. The 3 wrong answers for each question are randomly chosen from answers to other questions. So, you might find at times the answers obvious, but you will see it re-enforces your understanding as you take the test each time.
1. How is ARC done?
Sort of - in ways that it doesn't need to know much about the controller. For example: delegation.
Action
[Class respondsToSelector:@selector(aMethod)]
The compiler adds code to count references.
2. What do I use for an ordered collection of objects? And is it mutable?
3. If a method starts with a dash - it's a ___________. If it starts with a plus sign - it's a ______________.
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
Can handle any language because it uses Unicode.
Instance method; class method.
Strong. Object memory is freed at the end of the routine.
4. How can I find out the class of any object? Give a line of code.
'Keep this in the heap as long as someone else points to it strongly. If it gets thrown out of the heap - set my pointer to it to nil.'
No. It's fine.
Class XX = [Object class]
NO is zero; YES is anything else.
5. What is the makeup of a CGSize?
Two floats - for width and height
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
UIWindow
No...but it has 'a way' to notify the controller to come ask for fresh data.
6. What is the bounds property of a UIView?
option-click; option-double-click
create a model
internal origin and size. Use this inside a view
The document; possibly a database.
7. A _______ goes from the Controller to the View. A ________ goes from the view to the controller.
Yes. As much as it wants.
Outlet; Action
Argument validation.
NSArray; no - it's immutable.
8. What does the controller do?
Controls how the model is presented onscreen.
Cocoa Touch - Media - Core Services - Core OS
NSUserDefaults - which stores a property list.
My rectangle in my superview's coordinate space
9. The basic steps in custom drawing.
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
Argument validation.
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
Never!
10. The controller is always a subclass of...?
Interface; Implementation
Can handle any language because it uses Unicode.
Outlet; Action
UIViewController.
11. The setters for outlets are called by _______ at this point ______________.
Other MVC trios.
Designated initializer.
UIViewController.
iOS; when the view is loaded.
12. What is in the model?
UIViewController.
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
The document; possibly a database.
Two CGFloats for x and y
13. ________ is the .h file and __________ is the .m file.
Interface; Implementation
Never!
The document; possibly a database.
NSArray; no - it's immutable.
14. How about the model talking to the controller?
15. Is NSArray mutable?
NSUserDefaults - which stores a property list.
No. Use NSMutableArray - which is a subclass of NSArray.
create a model
Properties; instance variables
16. List the iOS hierarchy from top to bottom.
NSData
Cocoa Touch - Media - Core Services - Core OS
create a model
addSubview; removeFromSubview
17. What if I want to put a scalar into an NSArray or NSSet?
An outlet.
Wrap it in NSValue. And remember that NSValue immutable.
NSNumber. For example numberWithDouble: and doubleValue:
Never!
18. Why are properties good?
the controller's minions. Gets things to the screen.
Interface; Implementation
iOS; when the view is loaded.
(1) We can validate (e.g. bounds-check) any sets done by a subclass. (2) We can lazily instantiate - so things only get created if and when they are needed.
19. What is a property list?
Nothing happens - and nil is returned.
No - it gets the data from the controller.
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
addSubview; removeFromSubview
20. The decision on what method to call is made when?
Dash - Plus sign.
Wrap it in NSValue. And remember that NSValue immutable.
At runtime.
MVC - for model-view-controller
21. Dot notation does what?
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
[Object isMemberOfClass:[Classname class]]
Outlet; Action
On left side - is calling the setter - and on the right side - is calling the getter.
22. Calling a method on id works just fine because....?
Instance method; class method.
(1) We can validate (e.g. bounds-check) any sets done by a subclass. (2) We can lazily instantiate - so things only get created if and when they are needed.
The runtime system asks the object what its class is.
zero/nil
23. What about controller talking to the model?
id
Yes. The controller knows everything about the model.
constant NSString
internal origin and size. Use this inside a view
24. How can I save user information between launches of my app?
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
for...in; don't change things inside the loop.
Instance variable (ivar) or 'backing variable'
NSUserDefaults - which stores a property list.
25. What does a view (UIView) represent?
Don't use id for a pointer. Use the actual type pointed to. It allows the compiler (but not the runtime!) to help find bugs.
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
An outlet.
A rectangular area
26. In a nutshell: how to do custom drawing?
[Object isKindOfClass:[Classname class]]
Cocoa Touch - Media - Core Services - Core OS
Override drawRect:
Sort of - in ways that it doesn't need to know much about the controller. For example: delegation.
27. What do I use for a hash table/associative array? And is it mutable?
28. What is a reason to write our own setter?
Argument validation.
Yes. As much as it wants.
UIWindow
Two CGFloats for x and y
29. The view is...
30. What is the base class for most objects in the iOS SDK?
UIViewController.
option-click; option-double-click
NSObject
[Object isMemberOfClass:[Classname class]]
31. There is no difference between _____ and _______ at runtime.
[Object isMemberOfClass:[Classname class]]
NO is zero; YES is anything else.
[[UIView alloc] initWithFrame]
id; an object pointer
32. Instead of 'include' statements - in Objective-C we use _______ which does ________
A framework.
Import / handle multiple inclusion.
Never!
self = [super init] {if init is the designated initializer of the superclass}. If the superclass init routine fails - I will know to return nil from my init routine.
33. What is the makeup of a CGRect?
A CGPoint and and a CGSize
zero/nil
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
One; zero to many
34. Remember that it's cool to...
Never!
Override drawRect:
Right-click on view - or even a subview like a button.
line up the colons!
35. Does a view 'own' the data it displays?
Designated initializer.
Instance variable (ivar) or 'backing variable'
No - it gets the data from the controller.
for...in; don't change things inside the loop.
36. Class methods are used for ___________ and the call starts with ____________.
(1) We can validate (e.g. bounds-check) any sets done by a subclass. (2) We can lazily instantiate - so things only get created if and when they are needed.
line up the colons!
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
addSubview; removeFromSubview
37. What to do in Xcode for short documentation? For full documentation?
option-click; option-double-click
addSubview; removeFromSubview
No. It's fine.
Interface; Implementation
38. A _______ is how a view notifies the controller of something - for example - a button press.
Override drawRect:
[[UIView alloc] initWithFrame]
Action
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
39. How to instantiate an object?
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
addSubview; removeFromSubview
Nothing happens - and nil is returned.
Yes. The controller knows everything about the model.
40. How many superviews does a view have? How many subviews?
id
One; zero to many
Argument validation.
[Class respondsToSelector:@selector(aMethod)]
41. Can the controller talking to the view?
'Keep this in the heap until I don't point to anymore.' I won't point to it anymore if I set my pointer to nil - or if I am removed from the heap because no one points strongly to me.
Yes. As much as it wants.
constant NSString
A framework.
42. How to tell if an object is of a particular class? (Write a line of code)
A rectangular area
option-click; option-double-click
Yes. The controller knows everything about the model.
[Object isMemberOfClass:[Classname class]]
43. ________ implements the getter and setter. But we can always__________
@synthesize; write our own getter and/or setter.
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
NSDictionary; no - it's immutable.
UIViewController.
44. How to add subviews in code? How to remove them?
addSubview; removeFromSubview
id; an object pointer
The document; possibly a database.
option-click; option-double-click
45. What do I use for a bag of bits?
Strongly.
NSData
(1) We can validate (e.g. bounds-check) any sets done by a subclass. (2) We can lazily instantiate - so things only get created if and when they are needed.
No. It's fine.
46. A property is just the combination of _______.
Getter and setter methods.
NSDictionary; no - it's immutable.
self.view
[Class respondsToSelector:@selector(aMethod)]
47. What is the iOS term for a library?
A rectangular area
UIWindow
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
A framework.
48. What is the frame property of a UIView?
49. What is an example of a reason to write a getter?
Call setNeedsDisplay:
NSDictionary; no - it's immutable.
self.view
Lazy instantiation.
50. What is at the top of the view hierarchy?
NSLog; %@; %d and other formatters
[Object isMemberOfClass:[Classname class]]
UIWindow
NSNumber. For example numberWithDouble: and doubleValue: