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. The view is...
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
2. What is a property list?
Other MVC trios.
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
constant NSString
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
3. ______ is a pointer
id
Cocoa Touch - Media - Core Services - Core OS
self
Interface; Implementation
4. How is ARC done?
Interface; Implementation
The compiler adds code to count references.
id
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
5. What is a reason to write our own setter?
self
Argument validation.
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
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.
6. What is in the model?
Sort of - in ways that it doesn't need to know much about the controller. For example: delegation.
On left side - is calling the setter - and on the right side - is calling the getter.
The document; possibly a database.
line up the colons!
7. Can the controller talking to the view?
Import / handle multiple inclusion.
Yes. As much as it wants.
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.
NSSet; no - it's immutable
8. In a nutshell: how to do custom drawing?
[Class respondsToSelector:@selector(aMethod)]
internal origin and size. Use this inside a view
No - it gets the data from the controller.
Override drawRect:
9. Classes cannot have _________ or ___________.
Yes. The controller knows everything about the model.
id
The document; possibly a database.
Properties; instance variables
10. How many superviews does a view have? How many subviews?
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
One; zero to many
NSUserDefaults - which stores a property list.
id
11. The single-view template in Xcode does not...
Yes. As much as it wants.
Call setNeedsDisplay:
[Object isKindOfClass:[Classname class]]
create a model
12. 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
13. What is the makeup of a CGRect?
(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.
Other MVC trios.
Center of the frame - which is in the superview's coordinate system
A CGPoint and and a CGSize
14. What does the controller do?
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
Interface; Implementation
line up the colons!
Controls how the model is presented onscreen.
15. How to tell whether an object implements a particular method? (A line of code)
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
Properties; instance variables
line up the colons!
[Class respondsToSelector:@selector(aMethod)]
16. What is the fundamental design pattern of iOS development?
for...in; don't change things inside the loop.
MVC - for model-view-controller
Never!
NSArray; no - it's immutable.
17. What is an example of a reason to write a getter?
Lazy instantiation.
Never!
[Class respondsToSelector:@selector(aMethod)]
Nothing happens - and nil is returned.
18. The basic steps in custom drawing.
The document; possibly a database.
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
[[UIView alloc] initWithFrame]
line up the colons!
19. Some controllers have ____________ as their views.
Override drawRect:
Other MVC trios.
iOS; when the view is loaded.
MVC - for model-view-controller
20. ________ is the .h file and __________ is the .m file.
Never!
id; an object pointer
An outlet.
Interface; Implementation
21. Where do I initialize properties?
In the getter! This is called lazy instantiation.
iOS; when the view is loaded.
Introspection - with the class method 'class'
NSDictionary; no - it's immutable.
22. When is it OK to call drawRect: directly?
The compiler adds code to count references.
Never!
[Class respondsToSelector:@selector(aMethod)]
'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.'
23. 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
24. How are local variables initialized in iOS 5?
Instance method; class method.
To zero; so pointers are nil.
Override drawRect:
Lazy instantiation.
25. 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
26. The setters for outlets are called by _______ at this point ______________.
NSDictionary; no - it's immutable.
iOS; when the view is loaded.
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.
Can handle any language because it uses Unicode.
27. How to see all actions - outlets - incoming/outgoing segues on a view?
create a model
Yes. The controller knows everything about the model.
Right-click on view - or even a subview like a button.
No...but it has 'a way' to notify the controller to come ask for fresh data.
28. Talk about NSString
Lazy instantiation.
Can handle any language because it uses Unicode.
the controller's minions. Gets things to the screen.
The compiler adds code to count references.
29. How to access the controller's top view?
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.
Strong. Object memory is freed at the end of the routine.
self.view
A CGPoint and and a CGSize
30. What is the base class for most objects in the iOS SDK?
create a model
NSObject
At runtime.
In the getter! This is called lazy instantiation.
31. Objects in an array: are the pointed to strongly or weakly?
Never!
Strongly.
the controller's minions. Gets things to the screen.
Import / handle multiple inclusion.
32. What is the name of a property in the controller that it uses to talk to views?
UIWindow
Wrap it in NSValue. And remember that NSValue immutable.
An outlet.
Yes. The controller knows everything about the model.
33. What does 'strong' mean?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
34. How to tell if an object is of a particular class? (Write a line of code)
[Object isMemberOfClass:[Classname class]]
Right-click on view - or even a subview like a button.
[Class respondsToSelector:@selector(aMethod)]
self
35. 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
36. 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
37. 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
38. What to do in Xcode for short documentation? For full documentation?
option-click; option-double-click
Properties; instance variables
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
39. List the iOS hierarchy from top to bottom.
Dash - Plus sign.
Cocoa Touch - Media - Core Services - Core OS
Properties; instance variables
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
40. Show a private interface section.
Cocoa Touch - Media - Core Services - Core OS
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
NSObject
41. How to tell whether an object is of a class or class that inherits from that class? (Write a line of code)
internal origin and size. Use this inside a view
create a model
Argument validation.
[Object isKindOfClass:[Classname class]]
42. The controller is always a subclass of...?
the controller's minions. Gets things to the screen.
NSData
option-click; option-double-click
UIViewController.
43. What is the bounds property of a UIView?
Strong. Object memory is freed at the end of the routine.
internal origin and size. Use this inside a view
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
Properties; instance variables
44. 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
45. How can I save user information between launches of my app?
UIViewController.
At runtime.
NSUserDefaults - which stores a property list.
Outlet; Action
46. Is NSString mutable or not?
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.
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
Never!
Points - to achieve device-independence
47. Instead of 'include' statements - in Objective-C we use _______ which does ________
Properties; instance variables
No. Use NSMutableArray - which is a subclass of NSArray.
Argument validation.
Import / handle multiple inclusion.
48. What is used in lieu of pixels? And why?
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.
Points - to achieve device-independence
On left side - is calling the setter - and on the right side - is calling the getter.
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.
49. How can I find out the class of any object? Give a line of code.
line up the colons!
(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.
Class XX = [Object class]
The runtime system asks the object what its class is.
50. 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];
MVC - for model-view-controller
[Class respondsToSelector:@selector(aMethod)]
Getter and setter methods.