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. The setters for outlets are called by _______ at this point ______________.
iOS; when the view is loaded.
self
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
Never!
2. A property is just the combination of _______.
NSUserDefaults - which stores a property list.
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
Action
Getter and setter methods.
3. Dot notation does what?
Other MVC trios.
On left side - is calling the setter - and on the right side - is calling the getter.
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
The compiler adds code to count references.
4. How many superviews does a view have? How many subviews?
Override drawRect:
One; zero to many
Dash - Plus sign.
Class XX = [Object class]
5. What about controller talking to the model?
self.view
The compiler adds code to count references.
To zero; so pointers are nil.
Yes. The controller knows everything about the model.
6. What do I use for an ordered collection of objects? And is it mutable?
7. Class methods are used for ___________ and the call starts with ____________.
Instance variable (ivar) or 'backing variable'
iOS; when the view is loaded.
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.
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
8. What do I use for a hash table/associative array? And is it mutable?
9. Where do I initialize properties?
[[UIView alloc] initWithFrame]
Interface; Implementation
In the getter! This is called lazy instantiation.
Other MVC trios.
10. What is at the top of the view hierarchy?
Points - to achieve device-independence
[[UIView alloc] initWithFrame]
Properties; instance variables
UIWindow
11. What is the fundamental design pattern of iOS development?
One; zero to many
MVC - for model-view-controller
The runtime system asks the object what its class is.
zero/nil
12. What is static typing? Why is it good?
13. What is a property list?
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
NSNumber. For example numberWithDouble: and doubleValue:
UIWindow
NSData
14. What is used in lieu of pixels? And why?
At runtime.
Nothing happens - and nil is returned.
To zero; so pointers are nil.
Points - to achieve device-independence
15. How about the model talking to the controller?
16. Calling a method on id works just fine because....?
option-click; option-double-click
The runtime system asks the object what its class is.
No...but it has 'a way' to notify the controller to come ask for fresh data.
The document; possibly a database.
17. The view is...
18. What about the model and the view talking to one another?
The document; possibly a database.
Dash - Plus sign.
No. Use NSMutableArray - which is a subclass of NSArray.
Never!
19. When is it OK to call drawRect: directly?
Yes. As much as it wants.
No...but it has 'a way' to notify the controller to come ask for fresh data.
Never!
for...in; don't change things inside the loop.
20. ______ is a pointer to any object.
Argument validation.
[Class respondsToSelector:@selector(aMethod)]
id
[[UIView alloc] initWithFrame]
21. 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.
line up the colons!
In the getter! This is called lazy instantiation.
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
22. How to tell whether an object implements a particular method? (A line of code)
[Class respondsToSelector:@selector(aMethod)]
Outlet; Action
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.
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
23. What does 'strong' mean?
24. ________ is the .h file and __________ is the .m file.
Interface; Implementation
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.
The runtime system asks the object what its class is.
Nothing happens - and nil is returned.
25. In synthesize: @synthesize foo = _foo; The __foo_ is the ____________ or also known as the ___________________.
26. What about public/private in Objective-C?
27. What is an example of a reason to write a getter?
A framework.
for...in; don't change things inside the loop.
To zero; so pointers are nil.
Lazy instantiation.
28. What is the makeup of a CGSize?
Two floats - for width and height
[Object isMemberOfClass:[Classname class]]
Import / handle multiple inclusion.
Lazy instantiation.
29. What is the iOS term for a library?
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
iOS; when the view is loaded.
Never!
A framework.
30. What is the makeup of a CGPoint?
UIViewController.
Two CGFloats for x and y
[[UIView alloc] initWithFrame]
To zero; so pointers are nil.
31. The controller is always a subclass of...?
UIViewController.
Action
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
MVC - for model-view-controller
32. 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.
Yes. The controller knows everything about the model.
for...in; don't change things inside the loop.
NSNumber. For example numberWithDouble: and doubleValue:
33. What do I use for an unordered collection - e.g. test for membership? And is it mutable?
34. How to create a UIView in code?
To zero; so pointers are nil.
[[UIView alloc] initWithFrame]
Instance method; class method.
zero/nil
35. Instead of 'include' statements - in Objective-C we use _______ which does ________
iOS; when the view is loaded.
Import / handle multiple inclusion.
Outlet; Action
Sort of - in ways that it doesn't need to know much about the controller. For example: delegation.
36. There is no difference between _____ and _______ at runtime.
NSObject
[[UIView alloc] initWithFrame]
Wrap it in NSValue. And remember that NSValue immutable.
id; an object pointer
37. What if I want to put a scalar into an NSArray or NSSet?
Wrap it in NSValue. And remember that NSValue immutable.
@synthesize; write our own getter and/or setter.
In the getter! This is called lazy instantiation.
NSData
38. What does 'weak' mean?
39. In a nutshell: how to do custom drawing?
create a model
Instance variable (ivar) or 'backing variable'
No. Use NSMutableArray - which is a subclass of NSArray.
Override drawRect:
40. When happens when you send a message to nil?
Properties; instance variables
Controls how the model is presented onscreen.
[Object isMemberOfClass:[Classname class]]
Nothing happens - and nil is returned.
41. What is the frame property of a UIView?
42. Some controllers have ____________ as their views.
The runtime system asks the object what its class is.
NSSet; no - it's immutable
Outlet; Action
Other MVC trios.
43. How to add subviews in code? How to remove them?
One; zero to many
addSubview; removeFromSubview
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.
44. Talk about NSString
Import / handle multiple inclusion.
Can handle any language because it uses Unicode.
addSubview; removeFromSubview
The runtime system asks the object what its class is.
45. Remember that it's cool to...
Getter and setter methods.
line up the colons!
NSDictionary; no - it's immutable.
Instance variable (ivar) or 'backing variable'
46. How to tell if an object is of a particular class? (Write a line of code)
id
[Object isMemberOfClass:[Classname class]]
Instance method; class method.
Properties; instance variables
47. What is the makeup of a CGRect?
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
A CGPoint and and a CGSize
create a model
[Class respondsToSelector:@selector(aMethod)]
48. Is it always bad to send messages to id?
49. What do I use for a bag of bits?
Never!
Properties; instance variables
Action
NSData
50. 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];
Sort of - in ways that it doesn't need to know much about the controller. For example: delegation.
Interface; Implementation
No...but it has 'a way' to notify the controller to come ask for fresh data.