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. A _______ is how a view notifies the controller of something - for example - a button press.
self.view
No. It's fine.
Action
Sort of - in ways that it doesn't need to know much about the controller. For example: delegation.
2. What is the bounds property of a UIView?
Sort of - in ways that it doesn't need to know much about the controller. For example: delegation.
No...but it has 'a way' to notify the controller to come ask for fresh data.
Nothing happens - and nil is returned.
internal origin and size. Use this inside a view
3. What is used in lieu of pixels? And why?
No - it gets the data from the controller.
Points - to achieve device-independence
Instance method; class method.
To zero; so pointers are nil.
4. What does 'weak' mean?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
5. Remember that it's cool to...
NO is zero; YES is anything else.
line up the colons!
At runtime.
self.view
6. ________ implements the getter and setter. But we can always__________
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
Right-click on view - or even a subview like a button.
@synthesize; write our own getter and/or setter.
Instance variable (ivar) or 'backing variable'
7. There is no difference between _____ and _______ at runtime.
NO is zero; YES is anything else.
Other MVC trios.
id; an object pointer
Instance variable (ivar) or 'backing variable'
8. The setters for outlets are called by _______ at this point ______________.
the controller's minions. Gets things to the screen.
Argument validation.
iOS; when the view is loaded.
for...in; don't change things inside the loop.
9. How to tell whether an object is of a class or class that inherits from that class? (Write a line of code)
Interface; Implementation
One; zero to many
NSUserDefaults - which stores a property list.
[Object isKindOfClass:[Classname class]]
10. What about controller talking to the model?
An outlet.
zero/nil
Yes. The controller knows everything about the model.
'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.
11. What is the word for checking/verifying the type of an object?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
12. A _______ goes from the Controller to the View. A ________ goes from the view to the controller.
The document; possibly a database.
internal origin and size. Use this inside a view
Instance method; class method.
Outlet; Action
13. How to access the controller's top view?
To zero; so pointers are nil.
One; zero to many
self.view
[Class respondsToSelector:@selector(aMethod)]
14. What to do in Xcode for short documentation? For full documentation?
option-click; option-double-click
Yes. The controller knows everything about the model.
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
Class XX = [Object class]
15. The view is...
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
16. What is an example of a reason to write a getter?
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
Lazy instantiation.
Designated initializer.
(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.
17. Can the controller talking to the view?
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
[[UIView alloc] initWithFrame]
Cocoa Touch - Media - Core Services - Core OS
Yes. As much as it wants.
18. Class methods are used for ___________ and the call starts with ____________.
A CGPoint and and a CGSize
NSSet; no - it's immutable
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
'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.'
19. What if I want to put a scalar into an NSArray or NSSet?
Strongly.
Wrap it in NSValue. And remember that NSValue immutable.
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.
Right-click on view - or even a subview like a button.
20. What is the makeup of a CGSize?
NSNumber. For example numberWithDouble: and doubleValue:
Two floats - for width and height
Strongly.
constant NSString
21. The basic steps in custom drawing.
[Object isMemberOfClass:[Classname class]]
If it's in the header file - it's public. To make some private variables - you can put a private interface section at the top of an implementation file.
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
Right-click on view - or even a subview like a button.
22. If I need to convert a number to an object - use __________
NSNumber. For example numberWithDouble: and doubleValue:
NSUserDefaults - which stores a property list.
Center of the frame - which is in the superview's coordinate system
Argument validation.
23. How to add subviews in code? How to remove them?
UIViewController.
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.
addSubview; removeFromSubview
At runtime.
24. What is in the model?
Strongly.
The document; possibly a database.
[Object isMemberOfClass:[Classname class]]
Designated initializer.
25. How many superviews does a view have? How many subviews?
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
[[UIView alloc] initWithFrame]
[Class respondsToSelector:@selector(aMethod)]
One; zero to many
26. If a method starts with a dash - it's a ___________. If it starts with a plus sign - it's a ______________.
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
Import / handle multiple inclusion.
Instance method; class method.
id; an object pointer
27. How about the model talking to the controller?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
28. What is static typing? Why is it good?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
29. What do I use for a hash table/associative array? And is it mutable?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
30. How is ARC done?
Introspection - with the class method 'class'
The compiler adds code to count references.
The document; possibly a database.
At runtime.
31. Why are properties good?
At runtime.
Argument validation.
(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.
Dash - Plus sign.
32. What about the view talking to the controller?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
33. What is the makeup of a CGPoint?
the controller's minions. Gets things to the screen.
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.
Two CGFloats for x and y
No - it gets the data from the controller.
34. Show a private interface section.
NSSet; no - it's immutable
Sort of - in ways that it doesn't need to know much about the controller. For example: delegation.
In the getter! This is called lazy instantiation.
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
35. Calling a method on id works just fine because....?
constant NSString
Introspection - with the class method 'class'
NSLog; %@; %d and other formatters
The runtime system asks the object what its class is.
36. List the iOS hierarchy from top to bottom.
Other MVC trios.
id; an object pointer
Cocoa Touch - Media - Core Services - Core OS
Introspection - with the class method 'class'
37. What is the name of a property in the controller that it uses to talk to views?
option-click; option-double-click
'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.
An outlet.
Points - to achieve device-independence
38. What do I use for a bag of bits?
A framework.
constant NSString
NSData
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.
39. What is the iOS term for a library?
A rectangular area
A framework.
id; an object pointer
NSNumber. For example numberWithDouble: and doubleValue:
40. The decision on what method to call is made when?
NSUserDefaults - which stores a property list.
id
option-click; option-double-click
At runtime.
41. The single-view template in Xcode does not...
create a model
Two CGFloats for x and y
Right-click on view - or even a subview like a button.
[Object isKindOfClass:[Classname class]]
42. All properties are initialized to _____
zero/nil
'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.
Strongly.
Action
43. What do I use for an unordered collection - e.g. test for membership? And is it mutable?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
44. How to tell if an object is of a particular class? (Write a line of code)
NSDictionary; no - it's immutable.
self
Strong. Object memory is freed at the end of the routine.
[Object isMemberOfClass:[Classname class]]
45. All classes should have a __________________ to be called by subclasses.
[[UIView alloc] initWithFrame]
Call setNeedsDisplay:
Designated initializer.
NSArray; no - it's immutable.
46. The controller is always a subclass of...?
UIViewController.
If it's in the header file - it's public. To make some private variables - you can put a private interface section at the top of an implementation file.
NO is zero; YES is anything else.
Interface; Implementation
47. Is it always bad to send messages to id?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
48. What is the fundamental design pattern of iOS development?
[[UIView alloc] initWithFrame]
The runtime system asks the object what its class is.
MVC - for model-view-controller
the controller's minions. Gets things to the screen.
49. Some controllers have ____________ as their views.
Other MVC trios.
The document; possibly a database.
Lazy instantiation.
Argument validation.
50. How can I save user information between launches of my app?
NSUserDefaults - which stores a property list.
id; an object pointer
An outlet.
One; zero to many