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 does 'weak' mean?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
2. All classes should have a __________________ to be called by subclasses.
Lazy instantiation.
Other MVC trios.
Argument validation.
Designated initializer.
3. Some controllers have ____________ as their views.
Strongly.
iOS; when the view is loaded.
Other MVC trios.
Designated initializer.
4. In the initializer methods of objects I create - add what line of code? Why?
[Object isMemberOfClass:[Classname class]]
Getter and setter methods.
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.
A rectangular area
5. The single-view template in Xcode does not...
One; zero to many
create a model
At runtime.
[Object isMemberOfClass:[Classname class]]
6. Instead of 'include' statements - in Objective-C we use _______ which does ________
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.
id
NO is zero; YES is anything else.
Import / handle multiple inclusion.
7. Is NSArray mutable?
No. Use NSMutableArray - which is a subclass of NSArray.
NSObject
'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.'
Center of the frame - which is in the superview's coordinate system
8. What is the makeup of a CGSize?
NSSet; no - it's immutable
Two floats - for width and height
No...but it has 'a way' to notify the controller to come ask for fresh data.
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
9. What is at the top of the view hierarchy?
UIWindow
Two floats - for width and height
Yes. As much as it wants.
No - it gets the data from the controller.
10. There is no difference between _____ and _______ at runtime.
Interface; Implementation
Call setNeedsDisplay:
id; an object pointer
iOS; when the view is loaded.
11. How can I find out the class of any object? Give a line of code.
Call setNeedsDisplay:
On left side - is calling the setter - and on the right side - is calling the getter.
Class XX = [Object class]
Properties; instance variables
12. What is used in lieu of pixels? And why?
Points - to achieve device-independence
No - it gets the data from the controller.
NSDictionary; no - it's immutable.
Interface; Implementation
13. What is a property list?
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
constant NSString
At runtime.
id
14. What is the name of a property in the controller that it uses to talk to views?
[Object isMemberOfClass:[Classname class]]
An outlet.
Lazy instantiation.
Strong. Object memory is freed at the end of the routine.
15. The controller is always a subclass of...?
Getter and setter methods.
'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.'
UIViewController.
Introspection - with the class method 'class'
16. List the iOS hierarchy from top to bottom.
(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.
'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.
Cocoa Touch - Media - Core Services - Core OS
self.view
17. What is the makeup of a CGPoint?
[Object isMemberOfClass:[Classname class]]
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
Two CGFloats for x and y
The document; possibly a database.
18. A _______ goes from the Controller to the View. A ________ goes from the view to the controller.
Outlet; Action
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.
'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.
A CGPoint and and a CGSize
19. 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
20. How is ARC done?
The compiler adds code to count references.
Instance method; class method.
Never!
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
21. What is an example of a reason to write a getter?
Import / handle multiple inclusion.
[[UIView alloc] initWithFrame]
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
Lazy instantiation.
22. What if I want to put a scalar into an NSArray or NSSet?
No. Use NSMutableArray - which is a subclass of NSArray.
Wrap it in NSValue. And remember that NSValue immutable.
Call setNeedsDisplay:
Yes. The controller knows everything about the model.
23. Why are properties good?
Outlet; Action
In the getter! This is called lazy instantiation.
Yes. As much as it wants.
(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.
24. 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.
Nothing happens - and nil is returned.
A framework.
the controller's minions. Gets things to the screen.
25. Is NSString mutable or not?
constant NSString
self
the controller's minions. Gets things to the screen.
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
26. What is the iOS term for a library?
A framework.
Getter and setter methods.
Override drawRect:
zero/nil
27. Does a view 'own' the data it displays?
No - it gets the data from the controller.
Sort of - in ways that it doesn't need to know much about the controller. For example: delegation.
for...in; don't change things inside the loop.
line up the colons!
28. What to do in Xcode for short documentation? For full documentation?
Call setNeedsDisplay:
Controls how the model is presented onscreen.
create a model
option-click; option-double-click
29. 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
30. All properties are initialized to _____
NSObject
zero/nil
NO is zero; YES is anything else.
Strongly.
31. Talk about NSString
zero/nil
Can handle any language because it uses Unicode.
My rectangle in my superview's coordinate space
Dash - Plus sign.
32. 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
33. How to access the controller's top view?
create a model
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.
Nothing happens - and nil is returned.
self.view
34. What do I use for a bag of bits?
Override drawRect:
A framework.
Wrap it in NSValue. And remember that NSValue immutable.
NSData
35. Instance methods start with a ______ and class methods start with a ______.
constant NSString
At runtime.
Dash - Plus sign.
Strongly.
36. The decision on what method to call is made when?
An outlet.
The compiler adds code to count references.
Lazy instantiation.
At runtime.
37. Where do I initialize properties?
Import / handle multiple inclusion.
self.view
In the getter! This is called lazy instantiation.
constant NSString
38. 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
39. 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
40. Objects in an array: are the pointed to strongly or weakly?
Strongly.
for...in; don't change things inside the loop.
Yes. As much as it wants.
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
41. What does a view (UIView) represent?
Dash - Plus sign.
A rectangular area
UIViewController.
Wrap it in NSValue. And remember that NSValue immutable.
42. ______ is a pointer to any object.
create a model
Override drawRect:
Cocoa Touch - Media - Core Services - Core OS
id
43. How many superviews does a view have? How many subviews?
One; zero to many
Nothing happens - and nil is returned.
Properties; instance variables
the controller's minions. Gets things to the screen.
44. 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
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
On left side - is calling the setter - and on the right side - is calling the getter.
45. How to tell if an object is of a particular class? (Write a line of code)
Center of the frame - which is in the superview's coordinate system
Points - to achieve device-independence
UIViewController.
[Object isMemberOfClass:[Classname class]]
46. How to tell whether an object implements a particular method? (A line of code)
[Class respondsToSelector:@selector(aMethod)]
Nothing happens - and nil is returned.
NSSet; no - it's immutable
One; zero to many
47. What does the controller do?
Never!
MVC - for model-view-controller
The runtime system asks the object what its class is.
Controls how the model is presented onscreen.
48. The basic steps in custom drawing.
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
Sort of - in ways that it doesn't need to know much about the controller. For example: delegation.
[Object isMemberOfClass:[Classname class]]
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. In synthesize: @synthesize foo = _foo; The __foo_ is the ____________ or also known as the ___________________.
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
50. What is a reason to write our own setter?
Points - to achieve device-independence
Argument validation.
Lazy instantiation.
addSubview; removeFromSubview