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