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. How are local variables initialized in iOS 5?
Strong. Object memory is freed at the end of the routine.
[Class respondsToSelector:@selector(aMethod)]
To zero; so pointers are nil.
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
2. What is the fundamental design pattern of iOS development?
MVC - for model-view-controller
Strong. Object memory is freed at the end of the routine.
Override drawRect:
self
3. What is the makeup of a CGRect?
A CGPoint and and a CGSize
The compiler adds code to count references.
self
Never!
4. 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
5. How can I find out the class of any object? Give a line of code.
NSDictionary; no - it's immutable.
In the getter! This is called lazy instantiation.
Class XX = [Object class]
NSUserDefaults - which stores a property list.
6. How to access the controller's top view?
At runtime.
Right-click on view - or even a subview like a button.
No - it gets the data from the controller.
self.view
7. How to instantiate an object?
[Class respondsToSelector:@selector(aMethod)]
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
Points - to achieve device-independence
8. How is ARC done?
The compiler adds code to count references.
No...but it has 'a way' to notify the controller to come ask for fresh data.
the controller's minions. Gets things to the screen.
At runtime.
9. Is NSString mutable or not?
Introspection - with the class method 'class'
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
Strong. Object memory is freed at the end of the routine.
NO is zero; YES is anything else.
10. How to tell if an object is of a particular class? (Write a line of code)
'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.
[Object isMemberOfClass:[Classname class]]
iOS; when the view is loaded.
At runtime.
11. What does the controller do?
The compiler adds code to count references.
Dash - Plus sign.
'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.'
Controls how the model is presented onscreen.
12. Dot notation does what?
Getter and setter methods.
On left side - is calling the setter - and on the right side - is calling the getter.
[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.
13. How to force a redraw of a custom area?
Call setNeedsDisplay:
The document; possibly a database.
Points - to achieve device-independence
Can handle any language because it uses Unicode.
14. Calling a method on id works just fine because....?
Center of the frame - which is in the superview's coordinate system
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.
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
The runtime system asks the object what its class is.
15. Class methods are used for ___________ and the call starts with ____________.
Never!
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
The runtime system asks the object what its class is.
[[UIView alloc] initWithFrame]
16. When happens when you send a message to nil?
Center of the frame - which is in the superview's coordinate system
Nothing happens - and nil is returned.
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
the controller's minions. Gets things to the screen.
17. Where do I initialize properties?
Lazy instantiation.
Points - to achieve device-independence
In the getter! This is called lazy instantiation.
Strongly.
18. 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
No. It's fine.
Never!
In the getter! This is called lazy instantiation.
19. In the initializer methods of objects I create - add what line of code? Why?
zero/nil
MVC - for model-view-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.
20. What if I want to put a scalar into an NSArray or NSSet?
Call setNeedsDisplay:
Wrap it in NSValue. And remember that NSValue immutable.
Instance variable (ivar) or 'backing variable'
[[UIView alloc] initWithFrame]
21. The view is...
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
22. What does 'strong' mean?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
23. ________ implements the getter and setter. But we can always__________
NSDictionary; no - it's immutable.
@synthesize; write our own getter and/or setter.
Can handle any language because it uses Unicode.
(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. Objects in an array: are the pointed to strongly or weakly?
Wrap it in NSValue. And remember that NSValue immutable.
Argument validation.
Controls how the model is presented onscreen.
Strongly.
25. What is the base class for most objects in the iOS SDK?
Wrap it in NSValue. And remember that NSValue immutable.
NSObject
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.
Controls how the model is presented onscreen.
26. Some controllers have ____________ as their views.
Other MVC trios.
A framework.
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.
27. There is no difference between _____ and _______ at runtime.
id
id; an object pointer
Instance variable (ivar) or 'backing variable'
A rectangular area
28. What is in the model?
NSLog; %@; %d and other formatters
One; zero to many
[Object isMemberOfClass:[Classname class]]
The document; possibly a database.
29. 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
30. 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.
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.
Cocoa Touch - Media - Core Services - Core OS
NSData
31. 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
32. What is used in lieu of pixels? And why?
Call setNeedsDisplay:
Instance variable (ivar) or 'backing variable'
Action
Points - to achieve device-independence
33. What to do in Xcode for short documentation? For full documentation?
On left side - is calling the setter - and on the right side - is calling the getter.
option-click; option-double-click
A framework.
One; zero to many
34. When is it OK to call drawRect: directly?
On left side - is calling the setter - and on the right side - is calling the getter.
[Class respondsToSelector:@selector(aMethod)]
NSDictionary; no - it's immutable.
Never!
35. How many superviews does a view have? How many subviews?
Getter and setter methods.
iOS; when the view is loaded.
One; zero to many
No. It's fine.
36. A _______ is how a view notifies the controller of something - for example - a button press.
Yes. As much as it wants.
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.
Action
'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.
37. What about the model and the view talking to one another?
Action
NSSet; no - it's immutable
Never!
for...in; don't change things inside the loop.
38. What is at the top of the view hierarchy?
Can handle any language because it uses Unicode.
On left side - is calling the setter - and on the right side - is calling the getter.
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
UIWindow
39. What is a reason to write our own setter?
[Class respondsToSelector:@selector(aMethod)]
Argument validation.
In the getter! This is called lazy instantiation.
iOS; when the view is loaded.
40. 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
NSDictionary; no - it's immutable.
NO is zero; YES is anything else.
41. What is the iOS term for a library?
A framework.
'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.
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
No - it gets the data from the controller.
42. 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
43. What does a view (UIView) represent?
The document; possibly a database.
A rectangular area
Instance method; class method.
The compiler adds code to count references.
44. What is the bounds property of a UIView?
internal origin and size. Use this inside a view
option-click; option-double-click
UIWindow
@synthesize; write our own getter and/or setter.
45. In a nutshell: how to do custom drawing?
'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.'
Override drawRect:
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.
id
46. 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
47. How can I save user information between launches of my app?
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.
At runtime.
NSUserDefaults - which stores a property list.
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
48. Show a private interface section.
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
NSArray; no - it's immutable.
Yes. The controller knows everything about the model.
Controls how the model is presented onscreen.
49. If a method starts with a dash - it's a ___________. If it starts with a plus sign - it's a ______________.
Class XX = [Object class]
Argument validation.
NO is zero; YES is anything else.
Instance method; class method.
50. You can send a message to a...
constant NSString
Cocoa Touch - Media - Core Services - Core OS
A rectangular area
Controls how the model is presented onscreen.