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. Does a view 'own' the data it displays?
Controls how the model is presented onscreen.
A CGPoint and and a CGSize
No - it gets the data from the controller.
One; zero to many
2. What does the controller do?
self.view
Right-click on view - or even a subview like a button.
Points - to achieve device-independence
Controls how the model is presented onscreen.
3. How to see all actions - outlets - incoming/outgoing segues on a view?
Yes. The controller knows everything about the model.
Right-click on view - or even a subview like a button.
The document; possibly a database.
NO is zero; YES is anything else.
4. What do I use for a bag of bits?
A CGPoint and and a CGSize
A rectangular area
NSData
MVC - for model-view-controller
5. 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
6. 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
7. 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
8. How to access the controller's top view?
line up the colons!
NO is zero; YES is anything else.
self.view
create a model
9. The setters for outlets are called by _______ at this point ______________.
iOS; when the view is loaded.
Properties; instance variables
The compiler adds code to count references.
Points - to achieve device-independence
10. What does a view (UIView) represent?
In the getter! This is called lazy instantiation.
A rectangular area
MVC - for model-view-controller
The document; possibly a database.
11. ______ is a pointer to any object.
A rectangular area
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.
id
addSubview; removeFromSubview
12. You can send a message to a...
constant NSString
A CGPoint and and a CGSize
Argument validation.
for...in; don't change things inside the loop.
13. Talk about BOOL variables.
addSubview; removeFromSubview
NO is zero; YES is anything else.
create a model
Properties; instance variables
14. When is it OK to call drawRect: directly?
Never!
In the getter! This is called lazy instantiation.
On left side - is calling the setter - and on the right side - is calling the getter.
UIWindow
15. What is at the top of the view hierarchy?
Introspection - with the class method 'class'
Properties; instance variables
Cocoa Touch - Media - Core Services - Core OS
UIWindow
16. What is the makeup of a CGSize?
Interface; Implementation
[Object isMemberOfClass:[Classname class]]
Yes. As much as it wants.
Two floats - for width and height
17. Can the controller talking to the view?
Never!
Yes. As much as it wants.
Two floats - for width and height
My rectangle in my superview's coordinate space
18. 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
19. What is the base class for most objects in the iOS SDK?
for...in; don't change things inside the loop.
Wrap it in NSValue. And remember that NSValue immutable.
NSObject
Lazy instantiation.
20. How to tell whether an object implements a particular method? (A line of code)
Call setNeedsDisplay:
[Class respondsToSelector:@selector(aMethod)]
My rectangle in my superview's coordinate space
constant NSString
21. Classes cannot have _________ or ___________.
internal origin and size. Use this inside a view
NSNumber. For example numberWithDouble: and doubleValue:
the controller's minions. Gets things to the screen.
Properties; instance variables
22. Class methods are used for ___________ and the call starts with ____________.
for...in; don't change things inside the loop.
In the getter! This is called lazy instantiation.
Strong. Object memory is freed at the end of the routine.
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
23. Show a private interface section.
zero/nil
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
No...but it has 'a way' to notify the controller to come ask for fresh data.
id; an object pointer
24. Some controllers have ____________ as their views.
Strong. Object memory is freed at the end of the routine.
In the getter! This is called lazy instantiation.
Other MVC trios.
Class XX = [Object class]
25. 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
26. Use ______ to send debugging messages to the console. Use _____ for any object - which should return an string. Can also use ______.
The runtime system asks the object what its class is.
the controller's minions. Gets things to the screen.
option-click; option-double-click
NSLog; %@; %d and other formatters
27. What is a property list?
Interface; Implementation
A framework.
A CGPoint and and a CGSize
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
28. How to create a UIView in code?
No. Use NSMutableArray - which is a subclass of NSArray.
Import / handle multiple inclusion.
[[UIView alloc] initWithFrame]
The document; possibly a database.
29. All properties are initialized to _____
zero/nil
A rectangular area
id; an object pointer
Yes. As much as it wants.
30. How to tell whether an object is of a class or class that inherits from that class? (Write a line of code)
Getter and setter methods.
Cocoa Touch - Media - Core Services - Core OS
[Object isKindOfClass:[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.
31. The decision on what method to call is made when?
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
At runtime.
id; an object pointer
Getter and setter methods.
32. How are local variables initialized in iOS 5?
[Object isMemberOfClass:[Classname class]]
Right-click on view - or even a subview like a button.
To zero; so pointers are nil.
Outlet; Action
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. The view is...
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
35. How can I save user information between launches of my app?
Center of the frame - which is in the superview's coordinate system
NSUserDefaults - which stores a property list.
Points - to achieve device-independence
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.
36. When happens when you send a message to nil?
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.
UIViewController.
Nothing happens - and nil is returned.
zero/nil
37. Objects in an array: are the pointed to strongly or weakly?
In the getter! This is called lazy instantiation.
internal origin and size. Use this inside a view
Strongly.
Dash - Plus sign.
38. Instead of 'include' statements - in Objective-C we use _______ which does ________
'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.
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
Import / handle multiple inclusion.
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.
39. 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
40. A property is just the combination of _______.
Other MVC trios.
Getter and setter methods.
No. It's fine.
Strong. Object memory is freed at the end of the routine.
41. What is the makeup of a CGRect?
Nothing happens - and nil is returned.
No - it gets the data from the controller.
At runtime.
A CGPoint and and a CGSize
42. 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
43. How to force a redraw of a custom area?
addSubview; removeFromSubview
Call setNeedsDisplay:
NSLog; %@; %d and other formatters
Instance method; class method.
44. What is the name of a property in the controller that it uses to talk to views?
Introspection - with the class method 'class'
An outlet.
Sort of - in ways that it doesn't need to know much about the controller. For example: delegation.
[Object isMemberOfClass:[Classname class]]
45. In a nutshell: how to do custom drawing?
The document; possibly a database.
The runtime system asks the object what its class is.
Override drawRect:
Designated initializer.
46. 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
47. List the iOS hierarchy from top to bottom.
Two CGFloats for x and y
Cocoa Touch - Media - Core Services - Core OS
Outlet; Action
An outlet.
48. In the initializer methods of objects I create - add what line of code? Why?
Two CGFloats for x and y
NSUserDefaults - which stores a property list.
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.
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.
49. What to do in Xcode for short documentation? For full documentation?
The compiler adds code to count references.
Two CGFloats for x and y
option-click; option-double-click
Call setNeedsDisplay:
50. A _______ is how a view notifies the controller of something - for example - a button press.
Instance method; class method.
self
Action
Points - to achieve device-independence