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. Are local pointers to objects strong or weak? So what happens at the end of the routine?
Can handle any language because it uses Unicode.
Properties; instance variables
Never!
Strong. Object memory is freed at the end of the routine.
2. How can I save user information between launches of my app?
The document; possibly a database.
Properties; instance variables
NSUserDefaults - which stores a property list.
self
3. What is at the top of the view hierarchy?
UIWindow
constant NSString
A CGPoint and and a CGSize
The runtime system asks the object what its class is.
4. There is no difference between _____ and _______ at runtime.
No. Use NSMutableArray - which is a subclass of NSArray.
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
NSObject
id; an object pointer
5. What does 'weak' mean?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
6. In a nutshell: how to do custom drawing?
To zero; so pointers are nil.
NSArray; no - it's immutable.
No - it gets the data from the controller.
Override drawRect:
7. 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
8. What is the fundamental design pattern of iOS development?
option-click; option-double-click
MVC - for model-view-controller
My rectangle in my superview's coordinate space
Instance variable (ivar) or 'backing variable'
9. What is the makeup of a CGRect?
[Object isKindOfClass:[Classname class]]
A CGPoint and and a CGSize
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
NSLog; %@; %d and other formatters
10. Where do I initialize properties?
In the getter! This is called lazy instantiation.
Strongly.
Yes. As much as it wants.
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.
11. What does the controller do?
Controls how the model is presented onscreen.
Sort of - in ways that it doesn't need to know much about the controller. For example: delegation.
id
In the getter! This is called lazy instantiation.
12. List the iOS hierarchy from top to bottom.
Cocoa Touch - Media - Core Services - Core OS
Dash - Plus sign.
line up the colons!
Can handle any language because it uses Unicode.
13. You can send a message to a...
Getter and setter methods.
constant NSString
for...in; don't change things inside the loop.
[Object isKindOfClass:[Classname class]]
14. What if I want to put a scalar into an NSArray or NSSet?
To zero; so pointers are nil.
A CGPoint and and a CGSize
Wrap it in NSValue. And remember that NSValue immutable.
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
15. ______ is a pointer
self
Nothing happens - and nil is returned.
Yes. The controller knows everything about the model.
A framework.
16. All classes should have a __________________ to be called by subclasses.
NSSet; no - it's immutable
Designated initializer.
Lazy instantiation.
My rectangle in my superview's coordinate space
17. How to force a redraw of a custom area?
No...but it has 'a way' to notify the controller to come ask for fresh data.
Action
Wrap it in NSValue. And remember that NSValue immutable.
Call setNeedsDisplay:
18. Does a view 'own' the data it displays?
No - it gets the data from the controller.
Designated initializer.
An outlet.
Cocoa Touch - Media - Core Services - Core OS
19. What is an example of a reason to write a getter?
id
Lazy instantiation.
NSNumber. For example numberWithDouble: and doubleValue:
The document; possibly a database.
20. What about controller talking to the model?
Yes. The controller knows everything about the model.
id
Argument validation.
Lazy instantiation.
21. Dot notation does what?
On left side - is calling the setter - and on the right side - is calling the getter.
id; an object pointer
create a model
[Class respondsToSelector:@selector(aMethod)]
22. How many superviews does a view have? How many subviews?
Yes. The controller knows everything about the model.
The runtime system asks the object what its class is.
One; zero to many
Call setNeedsDisplay:
23. Remember that it's cool to...
One; zero to many
line up the colons!
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
24. 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
25. Why are properties good?
(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.
create a model
Interface; Implementation
Getter and setter methods.
26. Class methods are used for ___________ and the call starts with ____________.
One; zero to many
NSObject
Instance variable (ivar) or 'backing variable'
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
27. How to add subviews in code? How to remove them?
Sort of - in ways that it doesn't need to know much about the controller. For example: delegation.
addSubview; removeFromSubview
the controller's minions. Gets things to the screen.
Outlet; Action
28. Is NSString mutable or not?
Right-click on view - or even a subview like a button.
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
Instance variable (ivar) or 'backing variable'
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
29. What about the model and the view talking to one another?
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.
Center of the frame - which is in the superview's coordinate system
A framework.
Never!
30. Classes cannot have _________ or ___________.
zero/nil
Instance method; class method.
Properties; instance variables
self
31. If a method starts with a dash - it's a ___________. If it starts with a plus sign - it's a ______________.
A framework.
Right-click on view - or even a subview like a button.
Instance method; class method.
NSNumber. For example numberWithDouble: and doubleValue:
32. What is a property list?
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
Introspection - with the class method 'class'
A CGPoint and and a CGSize
UIWindow
33. 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
34. What does 'strong' mean?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
35. The setters for outlets are called by _______ at this point ______________.
self.view
A CGPoint and and a CGSize
Strongly.
iOS; when the view is loaded.
36. 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
37. ________ implements the getter and setter. But we can always__________
id
@synthesize; write our own getter and/or setter.
Yes. The controller knows everything about the model.
Lazy instantiation.
38. What is the iOS term for a library?
Can handle any language because it uses Unicode.
Properties; instance variables
Yes. As much as it wants.
A framework.
39. Use ______ to send debugging messages to the console. Use _____ for any object - which should return an string. Can also use ______.
Import / handle multiple inclusion.
NSLog; %@; %d and other formatters
[Object isKindOfClass:[Classname class]]
id; an object pointer
40. What is the frame property of a UIView?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
41. ________ is the .h file and __________ is the .m file.
NSUserDefaults - which stores a property list.
Can handle any language because it uses Unicode.
zero/nil
Interface; Implementation
42. How to tell whether an object implements a particular method? (A line of code)
No...but it has 'a way' to notify the controller to come ask for fresh data.
[Class respondsToSelector:@selector(aMethod)]
Override drawRect:
Call setNeedsDisplay:
43. What is the name of a property in the controller that it uses to talk to views?
NSArray; no - it's immutable.
An outlet.
NSDictionary; no - it's immutable.
Points - to achieve device-independence
44. What to do in Xcode for short documentation? For full documentation?
create a model
Introspection - with the class method 'class'
option-click; option-double-click
The document; possibly a database.
45. A _______ goes from the Controller to the View. A ________ goes from the view to the controller.
NSUserDefaults - which stores a property list.
Outlet; Action
Sort of - in ways that it doesn't need to know much about the controller. For example: delegation.
Cocoa Touch - Media - Core Services - Core OS
46. 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
47. 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];
A rectangular area
Controls how the model is presented onscreen.
[Class respondsToSelector:@selector(aMethod)]
48. When is it OK to call drawRect: directly?
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.
Two floats - for width and height
Strong. Object memory is freed at the end of the routine.
49. Objects in an array: are the pointed to strongly or weakly?
Strongly.
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
NSSet; no - it's immutable
Dash - Plus sign.
50. How can I find out the class of any object? Give a line of code.
Class XX = [Object class]
Properties; instance variables
UIWindow
self.view