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 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
2. What does 'weak' mean?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
3. When is it OK to call drawRect: directly?
At runtime.
Sort of - in ways that it doesn't need to know much about the controller. For example: delegation.
Strong. Object memory is freed at the end of the routine.
Never!
4. In a nutshell: how to do custom drawing?
NSUserDefaults - which stores a property list.
Override drawRect:
My rectangle in my superview's coordinate space
Yes. The controller knows everything about the model.
5. Classes cannot have _________ or ___________.
Can handle any language because it uses Unicode.
Properties; instance variables
One; zero to many
Action
6. 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
7. Talk about BOOL variables.
NO is zero; YES is anything else.
The document; possibly a database.
A framework.
A rectangular area
8. What is the fundamental design pattern of iOS development?
MVC - for model-view-controller
internal origin and size. Use this inside a view
zero/nil
Instance variable (ivar) or 'backing variable'
9. If a method starts with a dash - it's a ___________. If it starts with a plus sign - it's a ______________.
Instance method; class method.
Action
NSNumber. For example numberWithDouble: and doubleValue:
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
10. What about public/private in Objective-C?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
11. How can I find out the class of any object? Give a line of code.
Argument validation.
Sort of - in ways that it doesn't need to know much about the controller. For example: delegation.
Other MVC trios.
Class XX = [Object class]
12. What if I want to put a scalar into an NSArray or NSSet?
Wrap it in NSValue. And remember that NSValue immutable.
My rectangle in my superview's coordinate space
Can handle any language because it uses Unicode.
Strongly.
13. How to tell whether an object implements a particular method? (A line of code)
A CGPoint and and a CGSize
NSData
[Class respondsToSelector:@selector(aMethod)]
No...but it has 'a way' to notify the controller to come ask for fresh data.
14. In the initializer methods of objects I create - add what line of code? Why?
iOS; when the view is loaded.
Override drawRect:
Strongly.
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.
15. Calling a method on id works just fine because....?
create a model
The runtime system asks the object what its class is.
My rectangle in my superview's coordinate space
'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.'
16. Dot notation does what?
On left side - is calling the setter - and on the right side - is calling the getter.
option-click; option-double-click
[Object isMemberOfClass:[Classname class]]
Import / handle multiple inclusion.
17. What about controller talking to the model?
Yes. The controller knows everything about the model.
option-click; option-double-click
Nothing happens - and nil is returned.
Points - to achieve device-independence
18. What about the model and the view talking to one another?
Import / handle multiple inclusion.
NSData
Points - to achieve device-independence
Never!
19. The setters for outlets are called by _______ at this point ______________.
iOS; when the view is loaded.
Import / handle multiple inclusion.
No - it gets the data from the controller.
[Object isMemberOfClass:[Classname class]]
20. How to add subviews in code? How to remove them?
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
Strongly.
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
21. 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
22. 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
23. 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
24. What is the makeup of a CGPoint?
(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.
Two CGFloats for x and y
Right-click on view - or even a subview like a button.
NSUserDefaults - which stores a property list.
25. A property is just the combination of _______.
Getter and setter methods.
NSLog; %@; %d and other formatters
@synthesize; write our own getter and/or setter.
option-click; option-double-click
26. How are local variables initialized in iOS 5?
Dash - Plus sign.
@synthesize; write our own getter and/or setter.
To zero; so pointers are nil.
Call setNeedsDisplay:
27. What is the iOS term for a library?
Never!
A framework.
NSLog; %@; %d and other formatters
create a model
28. 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
29. How can I save user information between launches of my app?
Outlet; Action
NSUserDefaults - which stores a property list.
[[UIView alloc] initWithFrame]
Never!
30. How to see all actions - outlets - incoming/outgoing segues on a view?
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
Right-click on view - or even a subview like a button.
Import / handle multiple inclusion.
Call setNeedsDisplay:
31. What is the bounds property of a UIView?
The document; possibly a database.
A rectangular area
internal origin and size. Use this inside a view
Properties; instance variables
32. What is at the top of the view hierarchy?
Override drawRect:
Never!
UIWindow
self.view
33. What is an example of a reason to write a getter?
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
id; an object pointer
UIWindow
Lazy instantiation.
34. Use ______ to send debugging messages to the console. Use _____ for any object - which should return an string. Can also use ______.
No - it gets the data from the controller.
Properties; instance variables
Nothing happens - and nil is returned.
NSLog; %@; %d and other formatters
35. How to tell if an object is of a particular class? (Write a line of code)
Designated initializer.
[Object isMemberOfClass:[Classname class]]
The runtime system asks the object what its class is.
Introspection - with the class method 'class'
36. Is NSArray mutable?
No. Use NSMutableArray - which is a subclass of NSArray.
The runtime system asks the object what its class is.
Strong. Object memory is freed at the end of the routine.
In the getter! This is called lazy instantiation.
37. 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
38. All classes should have a __________________ to be called by subclasses.
Call setNeedsDisplay:
Designated initializer.
Import / handle multiple inclusion.
Lazy instantiation.
39. What is the name of a property in the controller that it uses to talk to views?
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
(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.
An outlet.
Interface; Implementation
40. ______ is a pointer to any object.
Nothing happens - and nil is returned.
NSUserDefaults - which stores a property list.
id
Call setNeedsDisplay:
41. What do I use for a bag of bits?
NSData
On left side - is calling the setter - and on the right side - is calling the getter.
NSDictionary; no - it's immutable.
Yes. As much as it wants.
42. You can send a message to a...
MVC - for model-view-controller
[[UIView alloc] initWithFrame]
The document; possibly a database.
constant NSString
43. All properties are initialized to _____
'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.
zero/nil
In the getter! This is called lazy instantiation.
Getter and setter methods.
44. Does a view 'own' the data it displays?
No - it gets the data from the controller.
for...in; don't change things inside the loop.
Can handle any language because it uses Unicode.
No...but it has 'a way' to notify the controller to come ask for fresh data.
45. What is the makeup of a CGRect?
A CGPoint and and a CGSize
NSLog; %@; %d and other formatters
To zero; so pointers are nil.
Call setNeedsDisplay:
46. What does a view (UIView) represent?
Class XX = [Object class]
No - it gets the data from the controller.
Right-click on view - or even a subview like a button.
A rectangular area
47. What does 'strong' mean?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
48. Objects in an array: are the pointed to strongly or weakly?
One; zero to many
Strongly.
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.
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.
49. What to do in Xcode for short documentation? For full documentation?
id
Outlet; Action
UIViewController.
option-click; option-double-click
50. What is used in lieu of pixels? And why?
for...in; don't change things inside the loop.
Outlet; Action
Points - to achieve device-independence
In the getter! This is called lazy instantiation.