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. All classes should have a __________________ to be called by subclasses.
Interface; Implementation
Outlet; Action
Designated initializer.
Strong. Object memory is freed at the end of the routine.
2. What to do in Xcode for short documentation? For full documentation?
option-click; option-double-click
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
Nothing happens - and nil is returned.
NSArray; no - it's immutable.
3. ______ is a pointer to any object.
Strong. Object memory is freed at the end of the routine.
id
At runtime.
NSNumber. For example numberWithDouble: and doubleValue:
4. If I need to convert a number to an object - use __________
[Class respondsToSelector:@selector(aMethod)]
Import / handle multiple inclusion.
Designated initializer.
NSNumber. For example numberWithDouble: and doubleValue:
5. What does 'strong' mean?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
6. A _______ goes from the Controller to the View. A ________ goes from the view to the controller.
Outlet; Action
self
MVC - for model-view-controller
One; zero to many
7. Can the controller talking to the view?
Yes. As much as it wants.
Properties; instance variables
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
NSDictionary; no - it's immutable.
8. Show a private interface section.
'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.
UIViewController.
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
Designated initializer.
9. 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
10. What about the model and the view talking to one another?
Never!
Call setNeedsDisplay:
Outlet; Action
On left side - is calling the setter - and on the right side - is calling the getter.
11. Class methods are used for ___________ and the call starts with ____________.
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
[Object isKindOfClass:[Classname class]]
Points - to achieve device-independence
An outlet.
12. What is at the top of the view hierarchy?
Points - to achieve device-independence
Strong. Object memory is freed at the end of the routine.
Introspection - with the class method 'class'
UIWindow
13. 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
14. The decision on what method to call is made when?
Interface; Implementation
self
At runtime.
for...in; don't change things inside the loop.
15. Does a view 'own' the data it displays?
Two CGFloats for x and y
On left side - is calling the setter - and on the right side - is calling the getter.
No - it gets the data from the controller.
iOS; when the view is loaded.
16. There is no difference between _____ and _______ at runtime.
id; an object pointer
Strong. Object memory is freed at the end of the routine.
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.'
17. Talk about NSString
Can handle any language because it uses Unicode.
Call setNeedsDisplay:
Getter and setter methods.
[[UIView alloc] initWithFrame]
18. How to see all actions - outlets - incoming/outgoing segues on a view?
Yes. The controller knows everything about the model.
@synthesize; write our own getter and/or setter.
Instance method; class method.
Right-click on view - or even a subview like a button.
19. What is a reason to write our own setter?
Strongly.
Import / handle multiple inclusion.
Argument validation.
A framework.
20. Classes cannot have _________ or ___________.
Introspection - with the class method 'class'
for...in; don't change things inside the loop.
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
Properties; instance variables
21. How to access the controller's top view?
Wrap it in NSValue. And remember that NSValue immutable.
Cocoa Touch - Media - Core Services - Core OS
Controls how the model is presented onscreen.
self.view
22. In the initializer methods of objects I create - add what line of code? Why?
constant NSString
Lazy instantiation.
One; zero to many
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.
23. Talk about BOOL variables.
id; an object pointer
NO is zero; YES is anything else.
zero/nil
Cocoa Touch - Media - Core Services - Core OS
24. Are local pointers to objects strong or weak? So what happens at the end of the routine?
Strong. Object memory is freed at the end of the routine.
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.
One; zero to many
Instance variable (ivar) or 'backing variable'
25. What about controller talking to the model?
A rectangular area
Call setNeedsDisplay:
No...but it has 'a way' to notify the controller to come ask for fresh data.
Yes. The controller knows everything about the model.
26. Calling a method on id works just fine because....?
On left side - is calling the setter - and on the right side - is calling the getter.
The runtime system asks the object what its class is.
Instance variable (ivar) or 'backing variable'
A rectangular area
27. What is used in lieu of pixels? And why?
[Class respondsToSelector:@selector(aMethod)]
Points - to achieve device-independence
Call setNeedsDisplay:
A framework.
28. You can send a message to a...
Two floats - for width and height
option-click; option-double-click
constant NSString
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.
29. When happens when you send a message to nil?
id; an object pointer
Action
Nothing happens - and nil is returned.
Controls how the model is presented onscreen.
30. Instead of 'include' statements - in Objective-C we use _______ which does ________
Import / handle multiple inclusion.
One; zero to many
Controls how the model is presented onscreen.
option-click; option-double-click
31. The setters for outlets are called by _______ at this point ______________.
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.
iOS; when the view is loaded.
No. It's fine.
Nothing happens - and nil is returned.
32. What does a view (UIView) represent?
A rectangular area
Call setNeedsDisplay:
Two floats - for width and height
To zero; so pointers are nil.
33. If a method starts with a dash - it's a ___________. If it starts with a plus sign - it's a ______________.
NSData
Instance method; class method.
line up the colons!
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.
34. How are local variables initialized in iOS 5?
option-click; option-double-click
(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.
Yes. As much as it wants.
To zero; so pointers are nil.
35. ______ is a pointer
id
iOS; when the view is loaded.
self
@synthesize; write our own getter and/or setter.
36. What do I use for a bag of bits?
id; an object pointer
NSData
NSArray; no - it's immutable.
MVC - for model-view-controller
37. A _______ is how a view notifies the controller of something - for example - a button press.
NSLog; %@; %d and other formatters
Yes. As much as it wants.
Outlet; Action
Action
38. All properties are initialized to _____
zero/nil
self.view
A rectangular area
Nothing happens - and nil is returned.
39. 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
40. ________ implements the getter and setter. But we can always__________
No. Use NSMutableArray - which is a subclass of NSArray.
@synthesize; write our own getter and/or setter.
Designated initializer.
Outlet; Action
41. 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
42. What is the fundamental design pattern of iOS development?
MVC - for model-view-controller
Never!
Action
zero/nil
43. What is in the model?
NSUserDefaults - which stores a property list.
self.view
Nothing happens - and nil is returned.
The document; possibly a database.
44. The view is...
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
45. What is the name of a property in the controller that it uses to talk to views?
A framework.
MVC - for model-view-controller
the controller's minions. Gets things to the screen.
An outlet.
46. Some controllers have ____________ as their views.
Instance variable (ivar) or 'backing variable'
for...in; don't change things inside the loop.
id; an object pointer
Other MVC trios.
47. What does 'weak' mean?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
48. Where do I initialize properties?
@synthesize; write our own getter and/or setter.
Never!
No...but it has 'a way' to notify the controller to come ask for fresh data.
In the getter! This is called lazy instantiation.
49. How can I save user information between launches of my app?
Dash - Plus sign.
addSubview; removeFromSubview
NSUserDefaults - which stores a property list.
Nothing happens - and nil is returned.
50. Is NSString mutable or not?
Properties; instance variables
Import / handle multiple inclusion.
Class XX = [Object class]
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.