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 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
2. 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
3. What do I use for a hash table/associative array? And is it mutable?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
4. How many superviews does a view have? How many subviews?
One; zero to many
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
zero/nil
5. What does the controller do?
At runtime.
NSSet; no - it's immutable
Controls how the model is presented onscreen.
MVC - for model-view-controller
6. What does 'strong' mean?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
7. 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
8. In the initializer methods of objects I create - add what line of code? 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.
No. It's fine.
A CGPoint and and a CGSize
Points - to achieve device-independence
9. All properties are initialized to _____
No - it gets the data from the controller.
[Class respondsToSelector:@selector(aMethod)]
self
zero/nil
10. What is the fundamental design pattern of iOS development?
Getter and setter methods.
MVC - for model-view-controller
Sort of - in ways that it doesn't need to know much about the controller. For example: delegation.
Right-click on view - or even a subview like a button.
11. In a nutshell: how to do custom drawing?
Two floats - for width and height
Override drawRect:
My rectangle in my superview's coordinate space
NSData
12. A _______ goes from the Controller to the View. A ________ goes from the view to the controller.
Center of the frame - which is in the superview's coordinate system
Outlet; 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.
Lazy instantiation.
13. What is the base class for most objects in the iOS SDK?
Controls how the model is presented onscreen.
A CGPoint and and a CGSize
NSObject
On left side - is calling the setter - and on the right side - is calling the getter.
14. How to tell whether an object implements a particular method? (A line of code)
An outlet.
[Class respondsToSelector:@selector(aMethod)]
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
15. How can I find out the class of any object? Give a line of code.
No. It's fine.
Class XX = [Object class]
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
NSSet; no - it's immutable
16. What does 'weak' mean?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
17. What is the name of a property in the controller that it uses to talk to views?
Yes. The controller knows everything about the model.
the controller's minions. Gets things to the screen.
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.
An outlet.
18. Classes cannot have _________ or ___________.
Properties; instance variables
Strong. Object memory is freed at the end of the routine.
Wrap it in NSValue. And remember that NSValue immutable.
The compiler adds code to count references.
19. What if I want to put a scalar into an NSArray or NSSet?
On left side - is calling the setter - and on the right side - is calling the getter.
Wrap it in NSValue. And remember that NSValue immutable.
NSNumber. For example numberWithDouble: and doubleValue:
No. Use NSMutableArray - which is a subclass of NSArray.
20. If I need to convert a number to an object - use __________
No. It's fine.
NSArray; no - it's immutable.
NSNumber. For example numberWithDouble: and doubleValue:
the controller's minions. Gets things to the screen.
21. If a method starts with a dash - it's a ___________. If it starts with a plus sign - it's a ______________.
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.
No. Use NSMutableArray - which is a subclass of NSArray.
Getter and setter methods.
Instance method; class method.
22. You can send a message to a...
constant NSString
Can handle any language because it uses Unicode.
Properties; instance variables
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.
23. ________ is the .h file and __________ is the .m file.
UIViewController.
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
Strongly.
Interface; Implementation
24. Is NSString mutable or not?
iOS; when the view is loaded.
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
option-click; option-double-click
Getter and setter methods.
25. What is an example of a reason to write a getter?
Lazy instantiation.
The document; possibly a database.
option-click; option-double-click
Other MVC trios.
26. 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.
zero/nil
Never!
self.view
27. What is the bounds property of a UIView?
internal origin and size. Use this inside a view
Properties; instance variables
NSDictionary; no - it's immutable.
'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.'
28. 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
29. What do I use for a bag of bits?
Two CGFloats for x and y
A CGPoint and and a CGSize
NSData
Right-click on view - or even a subview like a button.
30. The view is...
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
31. 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
32. Show a private interface section.
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
Instance method; class method.
[[UIView alloc] initWithFrame]
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
33. Talk about BOOL variables.
Dash - Plus sign.
UIViewController.
NO is zero; YES is anything else.
create a model
34. Talk about NSString
Can handle any language because it uses Unicode.
Instance variable (ivar) or 'backing variable'
Two floats - for width and height
'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.
35. The single-view template in Xcode does not...
create a model
Instance variable (ivar) or 'backing variable'
NSLog; %@; %d and other formatters
MVC - for model-view-controller
36. The decision on what method to call is made when?
Yes. The controller knows everything about the model.
zero/nil
At runtime.
Call setNeedsDisplay:
37. 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
38. Why are properties good?
(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.
Properties; instance variables
Outlet; Action
UIViewController.
39. What is used in lieu of pixels? And why?
line up the colons!
Never!
the controller's minions. Gets things to the screen.
Points - to achieve device-independence
40. What to do in Xcode for short documentation? For full documentation?
To zero; so pointers are nil.
option-click; option-double-click
On left side - is calling the setter - and on the right side - is calling the getter.
A framework.
41. How to see all actions - outlets - incoming/outgoing segues on a view?
Right-click on view - or even a subview like a button.
At runtime.
No. Use NSMutableArray - which is a subclass of NSArray.
Never!
42. 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
43. 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
44. How to force a redraw of a custom area?
Call setNeedsDisplay:
Properties; instance variables
[Object isKindOfClass:[Classname class]]
The document; possibly a database.
45. ________ implements the getter and setter. But we can always__________
Import / handle multiple inclusion.
Instance variable (ivar) or 'backing variable'
@synthesize; write our own getter and/or setter.
self
46. A property is just the combination of _______.
Getter and setter methods.
Cocoa Touch - Media - Core Services - Core OS
Two floats - for width and height
To zero; so pointers are nil.
47. How to instantiate an object?
Instance method; class method.
Call setNeedsDisplay:
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
NSSet; no - it's immutable
48. Is NSArray mutable?
MVC - for model-view-controller
No. Use NSMutableArray - which is a subclass of NSArray.
Instance method; class method.
Wrap it in NSValue. And remember that NSValue immutable.
49. How can I save user information between launches of my app?
Center of the frame - which is in the superview's coordinate system
NSUserDefaults - which stores a property list.
[Class respondsToSelector:@selector(aMethod)]
Strong. Object memory is freed at the end of the routine.
50. What does a view (UIView) represent?
A rectangular area
Introspection - with the class method 'class'
Strong. Object memory is freed at the end of the 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.