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. What do I use for a bag of bits?
iOS; when the view is loaded.
internal origin and size. Use this inside a view
NSData
Introspection - with the class method 'class'
2. What is the base class for most objects in the iOS SDK?
NSObject
NSData
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.
Points - to achieve device-independence
3. How many superviews does a view have? How many subviews?
To zero; so pointers are nil.
for...in; don't change things inside the loop.
Sort of - in ways that it doesn't need to know much about the controller. For example: delegation.
One; zero to many
4. Instance methods start with a ______ and class methods start with a ______.
Dash - Plus sign.
Yes. The controller knows everything about the model.
Strong. Object memory is freed at the end of the routine.
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
5. 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
6. Remember that it's cool to...
NSObject
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
Lazy instantiation.
line up the colons!
7. The setters for outlets are called by _______ at this point ______________.
Never!
Controls how the model is presented onscreen.
At runtime.
iOS; when the view is loaded.
8. List the iOS hierarchy from top to bottom.
@synthesize; write our own getter and/or setter.
Wrap it in NSValue. And remember that NSValue immutable.
(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.
Cocoa Touch - Media - Core Services - Core OS
9. If a method starts with a dash - it's a ___________. If it starts with a plus sign - it's a ______________.
[[UIView alloc] initWithFrame]
Argument validation.
Instance method; class method.
Lazy instantiation.
10. What is the bounds property of a UIView?
Dash - Plus sign.
Controls how the model is presented onscreen.
[[UIView alloc] initWithFrame]
internal origin and size. Use this inside a view
11. How to instantiate an object?
Getter and setter methods.
[Object isKindOfClass:[Classname class]]
To zero; so pointers are nil.
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
12. 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
13. A _______ goes from the Controller to the View. A ________ goes from the view to the controller.
Outlet; Action
NSNumber. For example numberWithDouble: and doubleValue:
Instance method; class method.
Wrap it in NSValue. And remember that NSValue immutable.
14. How is ARC done?
The compiler adds code to count references.
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
Center of the frame - which is in the superview's coordinate system
Import / handle multiple inclusion.
15. 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
16. How to tell whether an object implements a particular method? (A line of code)
[Class respondsToSelector:@selector(aMethod)]
No. It's fine.
Getter and setter methods.
NSSet; no - it's immutable
17. The single-view template in Xcode does not...
Can handle any language because it uses Unicode.
iOS; when the view is loaded.
create a model
[Object isKindOfClass:[Classname class]]
18. 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
19. What is an example of a reason to write a getter?
id
iOS; when the view is loaded.
Lazy instantiation.
'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.
20. How to create a UIView in code?
To zero; so pointers are nil.
for...in; don't change things inside the loop.
id; an object pointer
[[UIView alloc] initWithFrame]
21. Class methods are used for ___________ and the call starts with ____________.
Argument validation.
In the getter! This is called lazy instantiation.
@synthesize; write our own getter and/or setter.
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
22. What to do in Xcode for short documentation? For full documentation?
for...in; don't change things inside the loop.
option-click; option-double-click
Wrap it in NSValue. And remember that NSValue immutable.
'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.'
23. What is the center property of a UIView?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
24. Dot notation does what?
Interface; Implementation
Argument validation.
In the getter! This is called lazy instantiation.
On left side - is calling the setter - and on the right side - is calling the getter.
25. In a nutshell: how to do custom drawing?
zero/nil
Override drawRect:
Center of the frame - which is in the superview's coordinate system
A CGPoint and and a CGSize
26. There is no difference between _____ and _______ at runtime.
id; an object pointer
Action
id
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
27. How to add subviews in code? How to remove them?
Points - to achieve device-independence
Can handle any language because it uses Unicode.
UIWindow
addSubview; removeFromSubview
28. What is in 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.
One; zero to many
The document; possibly a database.
zero/nil
29. What if I want to put a scalar into an NSArray or NSSet?
Wrap it in NSValue. And remember that NSValue immutable.
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
Class XX = [Object class]
30. 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
31. ________ implements the getter and setter. But we can always__________
One; zero to many
NSLog; %@; %d and other formatters
@synthesize; write our own getter and/or setter.
id; an object pointer
32. What is at the top of the view hierarchy?
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
constant NSString
UIWindow
Getter and setter methods.
33. Use ______ to send debugging messages to the console. Use _____ for any object - which should return an string. Can also use ______.
NSLog; %@; %d and other formatters
[Object isKindOfClass:[Classname class]]
Nothing happens - and nil is returned.
the controller's minions. Gets things to the screen.
34. What is the makeup of a CGPoint?
Two floats - for width and height
Two CGFloats for x and y
for...in; don't change things inside the loop.
To zero; so pointers are nil.
35. How to see all actions - outlets - incoming/outgoing segues on a view?
id; an object pointer
Right-click on view - or even a subview like a button.
Instance variable (ivar) or 'backing variable'
One; zero to many
36. 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
37. All properties are initialized to _____
[Object isMemberOfClass:[Classname class]]
Designated initializer.
A rectangular area
zero/nil
38. What is used in lieu of pixels? And why?
The document; possibly a database.
the controller's minions. Gets things to the screen.
Strongly.
Points - to achieve device-independence
39. Talk about BOOL variables.
Other MVC trios.
MVC - for model-view-controller
NO is zero; YES is anything else.
Never!
40. Why are properties good?
The compiler adds code to count references.
Override drawRect:
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) 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.
41. How to tell if an object is of a particular class? (Write a line of code)
Getter and setter methods.
[Object isMemberOfClass:[Classname class]]
Override drawRect:
@synthesize; write our own getter and/or setter.
42. How can I save user information between launches of my app?
Interface; Implementation
Wrap it in NSValue. And remember that NSValue immutable.
To zero; so pointers are nil.
NSUserDefaults - which stores a property list.
43. What does 'weak' mean?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
44. How to do enumeration with NSArray - NSDictionary - etc?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
45. When is it OK to call drawRect: directly?
'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.'
iOS; when the view is loaded.
Getter and setter methods.
Never!
46. Does a view 'own' the data it displays?
Lazy instantiation.
No - it gets the data from the controller.
My rectangle in my superview's coordinate space
Never!
47. How to force a redraw of a custom area?
option-click; option-double-click
NSData
Action
Call setNeedsDisplay:
48. What about controller talking to the model?
Argument validation.
NSDictionary; no - it's immutable.
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.
49. What do I use for an ordered collection of objects? And is it mutable?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
50. What is the fundamental design pattern of iOS development?
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
NSObject
Can handle any language because it uses Unicode.
MVC - for model-view-controller