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