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 does a view (UIView) represent?
self
Two floats - for width and height
A CGPoint and and a CGSize
A rectangular area
2. Is NSString mutable or not?
A CGPoint and and a CGSize
[[UIView alloc] initWithFrame]
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
3. All properties are initialized to _____
An outlet.
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.
zero/nil
The runtime system asks the object what its class is.
4. When is it OK to call drawRect: directly?
zero/nil
addSubview; removeFromSubview
No. It's fine.
Never!
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. A property is just the combination of _______.
Never!
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
Getter and setter methods.
Yes. As much as it wants.
7. What to do in Xcode for short documentation? For full documentation?
An outlet.
option-click; option-double-click
The document; possibly a database.
(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.
8. What about the model and the view talking to one another?
Designated initializer.
Never!
Strong. Object memory is freed at the end of the routine.
(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.
9. Class methods are used for ___________ and the call starts with ____________.
Introspection - with the class method 'class'
iOS; when the view is loaded.
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
(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.
10. 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
11. If I need to convert a number to an object - use __________
NSNumber. For example numberWithDouble: and doubleValue:
Interface; Implementation
NSUserDefaults - which stores a property list.
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.
12. ________ is the .h file and __________ is the .m file.
Interface; Implementation
NSUserDefaults - which stores a property list.
NSLog; %@; %d and other formatters
'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.'
13. What about controller talking to the model?
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
Yes. The controller knows everything about the model.
Two floats - for width and height
NSData
14. 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
15. All classes should have a __________________ to be called by subclasses.
My rectangle in my superview's coordinate space
Properties; instance variables
Designated initializer.
iOS; when the view is loaded.
16. What is in the model?
NSNumber. For example numberWithDouble: and doubleValue:
The document; possibly a database.
id
At runtime.
17. How to add subviews in code? How to remove them?
addSubview; removeFromSubview
Strongly.
Can handle any language because it uses Unicode.
@synthesize; write our own getter and/or setter.
18. The controller is always a subclass of...?
addSubview; removeFromSubview
UIViewController.
Import / handle multiple inclusion.
Strong. Object memory is freed at the end of the routine.
19. What is the makeup of a CGRect?
A CGPoint and and a CGSize
id; an object pointer
My rectangle in my superview's coordinate space
for...in; don't change things inside the loop.
20. What do I use for a bag of bits?
[Class respondsToSelector:@selector(aMethod)]
NSData
zero/nil
Introspection - with the class method 'class'
21. How to create a UIView in code?
[[UIView alloc] initWithFrame]
Override drawRect:
Never!
Argument validation.
22. What is the frame property of a UIView?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
23. The setters for outlets are called by _______ at this point ______________.
NSSet; no - it's immutable
NO is zero; YES is anything else.
Center of the frame - which is in the superview's coordinate system
iOS; when the view is loaded.
24. Dot notation does what?
A rectangular area
On left side - is calling the setter - and on the right side - is calling the getter.
[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.
25. ________ implements the getter and setter. But we can always__________
Cocoa Touch - Media - Core Services - Core OS
Lazy instantiation.
the controller's minions. Gets things to the screen.
@synthesize; write our own getter and/or setter.
26. 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
27. The view is...
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
28. Talk about BOOL variables.
Override drawRect:
NO is zero; YES is anything else.
On left side - is calling the setter - and on the right side - is calling the getter.
Two CGFloats for x and y
29. Can the controller talking to the view?
Yes. As much as it wants.
line up the colons!
NO is zero; YES is anything else.
constant NSString
30. In the initializer methods of objects I create - add what line of code? Why?
No. It's fine.
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.
'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.'
(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.
31. A _______ is how a view notifies the controller of something - for example - a button press.
Action
UIWindow
'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.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
32. ______ is a pointer to any object.
id
Right-click on view - or even a subview like a button.
Center of the frame - which is in the superview's coordinate system
At runtime.
33. How to access the controller's top view?
On left side - is calling the setter - and on the right side - is calling the getter.
NSUserDefaults - which stores a property list.
self.view
the controller's minions. Gets things to the screen.
34. Instead of 'include' statements - in Objective-C we use _______ which does ________
Import / handle multiple inclusion.
Properties; instance variables
[Object isKindOfClass:[Classname class]]
Two CGFloats for x and y
35. Classes cannot have _________ or ___________.
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
Class XX = [Object class]
Properties; instance variables
Lazy instantiation.
36. 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
37. In a nutshell: how to do custom drawing?
Override drawRect:
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
internal origin and size. Use this inside a view
A framework.
38. 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.
NSLog; %@; %d and other formatters
Points - to achieve device-independence
NSSet; no - it's immutable
39. Are local pointers to objects strong or weak? So what happens at the end of the routine?
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
addSubview; removeFromSubview
Strong. Object memory is freed at the end of the routine.
Dash - Plus sign.
40. What does 'weak' mean?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
41. How are local variables initialized in iOS 5?
To zero; so pointers are nil.
My rectangle in my superview's coordinate space
zero/nil
constant NSString
42. What does the controller do?
NSLog; %@; %d and other formatters
Two CGFloats for x and y
Controls how the model is presented onscreen.
internal origin and size. Use this inside a view
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 can I find out the class of any object? Give a line of code.
line up the colons!
self
No. Use NSMutableArray - which is a subclass of NSArray.
Class XX = [Object class]
45. 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
46. You can send a message to a...
self
constant NSString
the controller's minions. Gets things to the screen.
NSArray; no - it's immutable.
47. Where do I initialize properties?
Override drawRect:
Call setNeedsDisplay:
Instance variable (ivar) or 'backing variable'
In the getter! This is called lazy instantiation.
48. How to see all actions - outlets - incoming/outgoing segues on a view?
Can handle any language because it uses Unicode.
NSDictionary; no - it's immutable.
Right-click on view - or even a subview like a button.
Never!
49. Why are properties good?
Override drawRect:
Import / handle multiple inclusion.
(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.
the controller's minions. Gets things to the screen.
50. A _______ goes from the Controller to the View. A ________ goes from the view to the controller.
Outlet; Action
The document; possibly a database.
No. It's fine.
Instance method; class method.