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 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
2. 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];
Cocoa Touch - Media - Core Services - Core OS
A rectangular area
On left side - is calling the setter - and on the right side - is calling the getter.
3. 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
4. Objects in an array: are the pointed to strongly or weakly?
Yes. As much as it wants.
(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.
Strongly.
5. Can the controller talking to the view?
Properties; instance variables
The compiler adds code to count references.
Yes. As much as it wants.
Never!
6. 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
7. Show a private interface section.
'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.
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
NSSet; no - it's immutable
id
8. ________ implements the getter and setter. But we can always__________
@synthesize; write our own getter and/or setter.
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
[Object isKindOfClass:[Classname class]]
No. It's fine.
9. How to access the controller's top view?
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.
iOS; when the view is loaded.
self.view
A rectangular area
10. When is it OK to call drawRect: directly?
the controller's minions. Gets things to the screen.
Never!
@synthesize; write our own getter and/or setter.
A rectangular area
11. What is the makeup of a CGSize?
NSDictionary; no - it's immutable.
NSSet; no - it's immutable
id
Two floats - for width and height
12. What is the base class for most objects in the iOS SDK?
Class XX = [Object class]
NSObject
No. It's fine.
Never!
13. How is ARC done?
[[UIView alloc] initWithFrame]
Dash - Plus sign.
Yes. The controller knows everything about the model.
The compiler adds code to count references.
14. How to add subviews in code? How to remove them?
addSubview; removeFromSubview
Class XX = [Object class]
UIViewController.
NSUserDefaults - which stores a property list.
15. What to do in Xcode for short documentation? For full documentation?
Wrap it in NSValue. And remember that NSValue immutable.
NSSet; 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.'
option-click; option-double-click
16. All properties are initialized to _____
Sort of - in ways that it doesn't need to know much about the controller. For example: delegation.
zero/nil
Call setNeedsDisplay:
Other MVC trios.
17. What is the iOS term for a library?
The compiler adds code to count references.
A framework.
Properties; instance variables
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
18. ______ is a pointer
self
My rectangle in my superview's coordinate space
Center of the frame - which is in the superview's coordinate system
Interface; Implementation
19. ______ is a pointer to any object.
id
Action
A rectangular area
No. It's fine.
20. A _______ is how a view notifies the controller of something - for example - a button press.
No - it gets the data from the controller.
Interface; Implementation
Yes. As much as it wants.
Action
21. Are local pointers to objects strong or weak? So what happens at the end of the routine?
Yes. As much as it wants.
Strong. Object memory is freed at the end of the routine.
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.
line up the colons!
22. How to create a UIView in code?
Center of the frame - which is in the superview's coordinate system
(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.
[[UIView alloc] initWithFrame]
Never!
23. Dot notation does what?
On left side - is calling the setter - and on the right side - is calling the getter.
[Object isMemberOfClass:[Classname class]]
NSData
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
24. The setters for outlets are called by _______ at this point ______________.
Interface; Implementation
A framework.
At runtime.
iOS; when the view is loaded.
25. Talk about NSString
Instance variable (ivar) or 'backing variable'
id
Getter and setter methods.
Can handle any language because it uses Unicode.
26. Instead of 'include' statements - in Objective-C we use _______ which does ________
No. It's fine.
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.
Import / handle multiple inclusion.
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
27. What is the name of a property in the controller that it uses to talk to views?
An outlet.
addSubview; removeFromSubview
internal origin and size. Use this inside a view
Strong. Object memory is freed at the end of the routine.
28. What is at the top of the view hierarchy?
UIWindow
option-click; option-double-click
Right-click on view - or even a subview like a button.
Instance variable (ivar) or 'backing variable'
29. You can send a message to a...
id; an object pointer
On left side - is calling the setter - and on the right side - is calling the getter.
constant NSString
NSNumber. For example numberWithDouble: and doubleValue:
30. 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.
Two CGFloats for x and y
Properties; instance variables
No. Use NSMutableArray - which is a subclass of NSArray.
31. 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
iOS; when the view is loaded.
NSUserDefaults - which stores a property list.
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.
32. What is a property list?
NSObject
'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.'
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
33. What is the fundamental design pattern of iOS development?
NSLog; %@; %d and other formatters
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.
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
MVC - for model-view-controller
34. How to tell if an object is of a particular class? (Write a line of code)
Class XX = [Object class]
[[UIView alloc] initWithFrame]
Dash - Plus sign.
[Object isMemberOfClass:[Classname class]]
35. Instance methods start with a ______ and class methods start with a ______.
The compiler adds code to count references.
Dash - Plus sign.
A CGPoint and and a CGSize
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
36. What about controller talking to the model?
option-click; option-double-click
Yes. The controller knows everything about the model.
UIWindow
Instance method; class method.
37. Where do I initialize properties?
Argument validation.
In the getter! This is called lazy instantiation.
UIWindow
Designated initializer.
38. The controller is always a subclass of...?
NO is zero; YES is anything else.
Yes. As much as it wants.
UIViewController.
for...in; don't change things inside the loop.
39. How to tell whether an object implements a particular method? (A line of code)
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
Nothing happens - and nil is returned.
[Class respondsToSelector:@selector(aMethod)]
zero/nil
40. 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
41. In the initializer methods of objects I create - add what line of code? Why?
NSDictionary; no - it's immutable.
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.
To zero; so pointers are nil.
Center of the frame - which is in the superview's coordinate system
42. The single-view template in Xcode does not...
create a model
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
Points - to achieve device-independence
No...but it has 'a way' to notify the controller to come ask for fresh data.
43. When happens when you send a message to nil?
constant NSString
A CGPoint and and a CGSize
Points - to achieve device-independence
Nothing happens - and nil is returned.
44. How can I find out the class of any object? Give a line of code.
Other MVC trios.
NO is zero; YES is anything else.
Class XX = [Object class]
No - it gets the data from the controller.
45. 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
46. What does 'weak' mean?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
47. 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
48. What does a view (UIView) represent?
Call setNeedsDisplay:
Wrap it in NSValue. And remember that NSValue immutable.
NSObject
A rectangular area
49. What is in the model?
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
Lazy instantiation.
the controller's minions. Gets things to the screen.
The document; possibly a database.
50. What is used in lieu of pixels? And why?
[[UIView alloc] initWithFrame]
Points - to achieve device-independence
internal origin and size. Use this inside a view
line up the colons!