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. A _______ goes from the Controller to the View. A ________ goes from the view to the controller.
zero/nil
Import / handle multiple inclusion.
Outlet; Action
Introspection - with the class method 'class'
2. Objects in an array: are the pointed to strongly or weakly?
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
No - it gets the data from the controller.
Strongly.
NSUserDefaults - which stores a property list.
3. Instead of 'include' statements - in Objective-C we use _______ which does ________
Import / handle multiple inclusion.
line up the colons!
In the getter! This is called lazy instantiation.
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
4. How are local variables initialized in iOS 5?
Other MVC trios.
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
To zero; so pointers are nil.
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
5. How to add subviews in code? How to remove them?
Yes. The controller knows everything about the model.
constant NSString
Strong. Object memory is freed at the end of the routine.
addSubview; removeFromSubview
6. What is an example of a reason to write a getter?
Class XX = [Object class]
Call setNeedsDisplay:
option-click; option-double-click
Lazy instantiation.
7. What about the model and the view talking to one another?
for...in; don't change things inside the loop.
Never!
Import / handle multiple inclusion.
addSubview; removeFromSubview
8. 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
9. What to do in Xcode for short documentation? For full documentation?
option-click; option-double-click
One; zero to many
(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.
Dash - Plus sign.
10. A _______ is how a view notifies the controller of something - for example - a button press.
iOS; when the view is loaded.
Action
option-click; option-double-click
Outlet; Action
11. Why are properties good?
No. Use NSMutableArray - which is a subclass of NSArray.
(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.
Action
Cocoa Touch - Media - Core Services - Core OS
12. How to create a UIView in code?
[[UIView alloc] initWithFrame]
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
self
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
13. 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.
One; zero to many
Lazy instantiation.
The compiler adds code to count references.
14. If I need to convert a number to an object - use __________
[Object isKindOfClass:[Classname class]]
NSNumber. For example numberWithDouble: and doubleValue:
(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.
Never!
15. 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
16. 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
17. Can the controller talking to the view?
UIViewController.
Two CGFloats for x and y
Yes. As much as it wants.
An outlet.
18. 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
19. The single-view template in Xcode does not...
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
create a model
addSubview; removeFromSubview
Yes. The controller knows everything about the model.
20. Remember that it's cool to...
A CGPoint and and a CGSize
Other MVC trios.
line up the colons!
NSDictionary; no - it's immutable.
21. The controller is always a subclass of...?
UIViewController.
@synthesize; write our own getter and/or setter.
To zero; so pointers are nil.
NSArray; no - it's immutable.
22. When happens when you send a message to nil?
A framework.
Nothing happens - and nil is returned.
Center of the frame - which is in the superview's coordinate system
id
23. How many superviews does a view have? How many subviews?
Strongly.
A CGPoint and and a CGSize
Dash - Plus sign.
One; zero to many
24. Calling a method on id works just fine because....?
Two floats - for width and height
for...in; don't change things inside the loop.
The runtime system asks the object what its class is.
Two CGFloats for x and y
25. What is the word for checking/verifying the type of an object?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
26. What does 'strong' mean?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
27. 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];
No. It's fine.
id
Action
28. How to tell if an object is of a particular class? (Write a line of code)
Introspection - with the class method 'class'
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
Sort of - in ways that it doesn't need to know much about the controller. For example: delegation.
[Object isMemberOfClass:[Classname class]]
29. Class methods are used for ___________ and the call starts with ____________.
Center of the frame - which is in the superview's coordinate system
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
On left side - is calling the setter - and on the right side - is calling the getter.
A CGPoint and and a CGSize
30. ______ is a pointer
self
Action
addSubview; removeFromSubview
Designated initializer.
31. A property is just the combination of _______.
To zero; so pointers are nil.
Getter and setter methods.
The runtime system asks the object what its class is.
Sort of - in ways that it doesn't need to know much about the controller. For example: delegation.
32. What do I use for a bag of bits?
Interface; Implementation
[[UIView alloc] initWithFrame]
NSData
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
33. What is used in lieu of pixels? And why?
zero/nil
Instance variable (ivar) or 'backing variable'
Points - to achieve device-independence
Action
34. How is ARC done?
Strongly.
Instance variable (ivar) or 'backing variable'
[[UIView alloc] initWithFrame]
The compiler adds code to count references.
35. In a nutshell: how to do custom drawing?
Override drawRect:
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
Instance method; class method.
MVC - for model-view-controller
36. 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
37. How can I save user information between launches of my app?
Yes. The controller knows everything about the model.
A CGPoint and and a CGSize
NSUserDefaults - which stores a property list.
[Class respondsToSelector:@selector(aMethod)]
38. Show a private interface section.
NO is zero; YES is anything else.
Class XX = [Object class]
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
A framework.
39. Talk about BOOL variables.
NO is zero; YES is anything else.
NSUserDefaults - which stores a property list.
My rectangle in my superview's coordinate space
(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.
40. There is no difference between _____ and _______ at runtime.
Instance variable (ivar) or 'backing variable'
id; an object pointer
Override drawRect:
Getter and setter methods.
41. Does a view 'own' the data it displays?
Designated initializer.
No - it gets the data from the controller.
NSObject
create a model
42. What is the makeup of a CGSize?
On left side - is calling the setter - and on the right side - is calling the getter.
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
Getter and setter methods.
43. Is NSString mutable or not?
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
Action
Interface; Implementation
[Object isKindOfClass:[Classname class]]
44. How to tell whether an object is of a class or class that inherits from that class? (Write a line of code)
[Object isKindOfClass:[Classname class]]
Can handle any language because it uses Unicode.
Getter and setter methods.
Points - to achieve device-independence
45. List the iOS hierarchy from top to bottom.
Class XX = [Object class]
The runtime system asks the object what its class is.
self
Cocoa Touch - Media - Core Services - Core OS
46. What is a property list?
Outlet; Action
Right-click on view - or even a subview like a button.
NO is zero; YES is anything else.
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
47. ________ is the .h file and __________ is the .m file.
self.view
UIViewController.
(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.
Interface; Implementation
48. How to tell whether an object implements a particular method? (A line of code)
Never!
[Class respondsToSelector:@selector(aMethod)]
id
A rectangular area
49. Talk about NSString
UIViewController.
Can handle any language because it uses Unicode.
Nothing happens - and nil is returned.
zero/nil
50. The decision on what method to call is made when?
NSObject
At runtime.
A framework.
NSNumber. For example numberWithDouble: and doubleValue: