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 a property list?
A rectangular area
No. It's fine.
NSDictionary; no - it's immutable.
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
2. What is the fundamental design pattern of iOS development?
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
MVC - for model-view-controller
'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.
zero/nil
3. When is it OK to call drawRect: directly?
constant NSString
Class XX = [Object class]
Never!
Two floats - for width and height
4. Instance methods start with a ______ and class methods start with a ______.
Dash - Plus sign.
the controller's minions. Gets things to the screen.
At runtime.
In the getter! This is called lazy instantiation.
5. List the iOS hierarchy from top to bottom.
Wrap it in NSValue. And remember that NSValue immutable.
Cocoa Touch - Media - Core Services - Core OS
Right-click on view - or even a subview like a button.
Points - to achieve device-independence
6. 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
7. What about the model and the view talking to one another?
Never!
Import / handle multiple inclusion.
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
option-click; option-double-click
8. ______ is a pointer
self
A framework.
Wrap it in NSValue. And remember that NSValue immutable.
No - it gets the data from the controller.
9. Is NSArray mutable?
Action
No. Use NSMutableArray - which is a subclass of NSArray.
(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.
Strong. Object memory is freed at the end of the routine.
10. 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
11. If I need to convert a number to an object - use __________
Right-click on view - or even a subview like a button.
Outlet; Action
Strongly.
NSNumber. For example numberWithDouble: and doubleValue:
12. There is no difference between _____ and _______ at runtime.
Action
@synthesize; write our own getter and/or setter.
id; an object pointer
Cocoa Touch - Media - Core Services - Core OS
13. The basic steps in custom drawing.
To zero; so pointers are nil.
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
Dash - Plus sign.
One; zero to many
14. 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
15. What to do in Xcode for short documentation? For full documentation?
option-click; option-double-click
Never!
A rectangular area
[Class respondsToSelector:@selector(aMethod)]
16. Show a private interface section.
Controls how the model is presented onscreen.
Wrap it in NSValue. And remember that NSValue immutable.
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
NSObject
17. How to create a UIView in code?
NO is zero; YES is anything else.
No...but it has 'a way' to notify the controller to come ask for fresh data.
[[UIView alloc] initWithFrame]
Designated initializer.
18. How to tell whether an object implements a particular method? (A line of code)
Introspection - with the class method 'class'
'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.'
self
[Class respondsToSelector:@selector(aMethod)]
19. What is the iOS term for a library?
One; zero to many
In the getter! This is called lazy instantiation.
A framework.
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
20. How to add subviews in code? How to remove them?
One; zero to many
Never!
addSubview; removeFromSubview
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
21. What is at the top of the view hierarchy?
To zero; so pointers are nil.
Cocoa Touch - Media - Core Services - Core OS
UIWindow
Override drawRect:
22. If a method starts with a dash - it's a ___________. If it starts with a plus sign - it's a ______________.
Can handle any language because it uses Unicode.
Instance method; class method.
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
Controls how the model is presented onscreen.
23. How can I save user information between launches of my app?
Getter and setter methods.
On left side - is calling the setter - and on the right side - is calling the getter.
NO is zero; YES is anything else.
NSUserDefaults - which stores a property list.
24. Calling a method on id works just fine because....?
(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 runtime system asks the object what its class is.
iOS; when the view is loaded.
the controller's minions. Gets things to the screen.
25. 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.
NSData
No...but it has 'a way' to notify the controller to come ask for fresh data.
[Object isKindOfClass:[Classname class]]
26. In a nutshell: how to do custom drawing?
Override drawRect:
Cocoa Touch - Media - Core Services - Core OS
No - it gets the data from the controller.
In the getter! This is called lazy instantiation.
27. Where do I initialize properties?
Introspection - with the class method 'class'
NO is zero; YES is anything else.
NSLog; %@; %d and other formatters
In the getter! This is called lazy instantiation.
28. Are local pointers to objects strong or weak? So what happens at the end of the routine?
Sort of - in ways that it doesn't need to know much about the controller. For example: delegation.
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.
Cocoa Touch - Media - Core Services - Core OS
29. 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
30. How can I find out the class of any object? Give a line of code.
Class XX = [Object class]
create a model
Points - to achieve device-independence
Never!
31. What do I use for a bag of bits?
Right-click on view - or even a subview like a button.
NSData
In the getter! This is called lazy instantiation.
Import / handle multiple inclusion.
32. How many superviews does a view have? How many subviews?
MVC - for model-view-controller
option-click; option-double-click
One; zero to many
[Object isMemberOfClass:[Classname class]]
33. The single-view template in Xcode does not...
[Object isMemberOfClass:[Classname class]]
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.
Two floats - for width and height
create a model
34. Can the controller talking to the view?
Yes. As much as it wants.
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.
create a model
An outlet.
35. What is the makeup of a CGSize?
Introspection - with the class method 'class'
Two floats - for width and height
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.
iOS; when the view is loaded.
36. Talk about BOOL variables.
NO is zero; YES is anything else.
Designated initializer.
An outlet.
Outlet; Action
37. 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
38. What does the controller do?
Controls how the model is presented onscreen.
Class XX = [Object class]
[Class respondsToSelector:@selector(aMethod)]
id
39. How to tell if an object is of a particular class? (Write a line of code)
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
constant NSString
Yes. As much as it wants.
[Object isMemberOfClass:[Classname class]]
40. What is the makeup of a CGPoint?
Two CGFloats for x and y
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
Outlet; Action
[[UIView alloc] initWithFrame]
41. ________ is the .h file and __________ is the .m file.
internal origin and size. Use this inside a view
Interface; Implementation
No. It's fine.
One; zero to many
42. Some controllers have ____________ as their views.
Yes. The controller knows everything about the model.
Other MVC trios.
A framework.
At runtime.
43. ______ is a pointer to any object.
id
Instance variable (ivar) or 'backing variable'
Strong. Object memory is freed at the end of the routine.
Yes. As much as it wants.
44. How to instantiate an object?
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
At runtime.
zero/nil
Never!
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. ________ implements the getter and setter. But we can always__________
@synthesize; write our own getter and/or setter.
NSNumber. For example numberWithDouble: and doubleValue:
To zero; so pointers are nil.
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
47. 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
48. Instead of 'include' statements - in Objective-C we use _______ which does ________
Import / handle multiple inclusion.
Override drawRect:
Two CGFloats for x and y
[Object isKindOfClass:[Classname class]]
49. What is used in lieu of pixels? And why?
NSArray; no - it's immutable.
Points - to achieve device-independence
NSNumber. For example numberWithDouble: and doubleValue:
Argument validation.
50. How to force a redraw of a custom area?
Call setNeedsDisplay:
NSNumber. For example numberWithDouble: and doubleValue:
id; an object pointer
Override drawRect: