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. A _______ is how a view notifies the controller of something - for example - a button press.
Two floats - for width and height
UIViewController.
Instance variable (ivar) or 'backing variable'
Action
2. ________ is the .h file and __________ is the .m file.
Interface; Implementation
One; zero to many
On left side - is calling the setter - and on the right side - is calling the getter.
A rectangular area
3. What do I use for an ordered collection of objects? And is it mutable?
4. All classes should have a __________________ to be called by subclasses.
NSDictionary; no - it's immutable.
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
Designated initializer.
Other MVC trios.
5. What does 'weak' mean?
6. Use ______ to send debugging messages to the console. Use _____ for any object - which should return an string. Can also use ______.
Lazy instantiation.
No - it gets the data from the controller.
Can handle any language because it uses Unicode.
NSLog; %@; %d and other formatters
7. Remember that it's cool to...
(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.
id; an object pointer
Introspection - with the class method 'class'
line up the colons!
8. When happens when you send a message to nil?
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
[Object isKindOfClass:[Classname class]]
No - it gets the data from the controller.
Nothing happens - and nil is returned.
9. What is a reason to write our own setter?
An outlet.
Argument validation.
No...but it has 'a way' to notify the controller to come ask for fresh data.
To zero; so pointers are nil.
10. What is the bounds property of a UIView?
Two CGFloats for x and y
Controls how the model is presented onscreen.
addSubview; removeFromSubview
internal origin and size. Use this inside a view
11. What about controller talking to the model?
addSubview; removeFromSubview
'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.
Yes. The controller knows everything about the model.
Instance method; class method.
12. How are local variables initialized in iOS 5?
A rectangular area
To zero; so pointers are nil.
option-click; option-double-click
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
13. What is the makeup of a CGRect?
A rectangular area
id; an object pointer
One; zero to many
A CGPoint and and a CGSize
14. How can I find out the class of any object? Give a line of code.
NSUserDefaults - which stores a property list.
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
[[UIView alloc] initWithFrame]
Class XX = [Object class]
15. How to tell if an object is of a particular class? (Write a line of code)
NSArray; no - it's immutable.
Lazy instantiation.
Strongly.
[Object isMemberOfClass:[Classname class]]
16. In the initializer methods of objects I create - add what line of code? Why?
Lazy instantiation.
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 CGPoint and and a CGSize
Action
17. The decision on what method to call is made when?
At runtime.
NSSet; no - it's immutable
[Object isKindOfClass:[Classname class]]
Right-click on view - or even a subview like a button.
18. The controller is always a subclass of...?
Import / handle multiple inclusion.
Sort of - in ways that it doesn't need to know much about the controller. For example: delegation.
iOS; when the view is loaded.
UIViewController.
19. What does 'strong' mean?
20. How many superviews does a view have? How many subviews?
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
One; zero to many
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.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
21. How to tell whether an object is of a class or class that inherits from that class? (Write a line of code)
[Object isKindOfClass:[Classname class]]
Strong. Object memory is freed at the end of the routine.
Argument validation.
Call setNeedsDisplay:
22. You can send a message to a...
constant NSString
Never!
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.
Instance variable (ivar) or 'backing variable'
23. A property is just the combination of _______.
NSDictionary; no - it's immutable.
Outlet; Action
Getter and setter methods.
No. It's fine.
24. What does a view (UIView) represent?
A rectangular area
No - it gets the data from the controller.
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
Dash - Plus sign.
25. How to instantiate an object?
'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.
internal origin and size. Use this inside a view
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
On left side - is calling the setter - and on the right side - is calling the getter.
26. The view is...
27. How to create a UIView in code?
Lazy instantiation.
Nothing happens - and nil is returned.
[[UIView alloc] initWithFrame]
The document; possibly a database.
28. Does a view 'own' the data it displays?
NSNumber. For example numberWithDouble: and doubleValue:
The document; possibly a database.
Cocoa Touch - Media - Core Services - Core OS
No - it gets the data from the controller.
29. What is at the top of the view hierarchy?
'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.
UIWindow
The document; possibly a database.
The compiler adds code to count references.
30. ________ implements the getter and setter. But we can always__________
for...in; don't change things inside the loop.
@synthesize; write our own getter and/or setter.
Import / handle multiple inclusion.
Strong. Object memory is freed at the end of the routine.
31. In a nutshell: how to do custom drawing?
Properties; instance variables
Two CGFloats for x and y
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
Override drawRect:
32. Why are properties good?
In the getter! This is called lazy instantiation.
(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.
Never!
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.
33. How about the model talking to the controller?
34. The single-view template in Xcode does not...
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
NO is zero; YES is anything else.
create a model
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
35. When is it OK to call drawRect: directly?
Introspection - with the class method 'class'
Call setNeedsDisplay:
Never!
Properties; instance variables
36. What is the word for checking/verifying the type of an object?
37. Is NSArray mutable?
Introspection - with the class method 'class'
NSUserDefaults - which stores a property list.
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.
No. Use NSMutableArray - which is a subclass of NSArray.
38. Can the controller talking to the view?
iOS; when the view is loaded.
The compiler adds code to count references.
line up the colons!
Yes. As much as it wants.
39. All properties are initialized to _____
At runtime.
zero/nil
'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.
Call setNeedsDisplay:
40. In synthesize: @synthesize foo = _foo; The __foo_ is the ____________ or also known as the ___________________.
41. How to access the controller's top view?
self.view
[[UIView alloc] initWithFrame]
Cocoa Touch - Media - Core Services - Core OS
Introspection - with the class method 'class'
42. How is ARC done?
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
No - it gets the data from the controller.
The compiler adds code to count references.
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
43. What to do in Xcode for short documentation? For full documentation?
id; an object pointer
option-click; option-double-click
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
The document; possibly a database.
44. If a method starts with a dash - it's a ___________. If it starts with a plus sign - it's a ______________.
Instance method; class method.
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.
Lazy instantiation.
NSNumber. For example numberWithDouble: and doubleValue:
45. What do I use for a bag of bits?
To zero; so pointers are nil.
self
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
NSData
46. Are local pointers to objects strong or weak? So what happens at the end of the routine?
MVC - for model-view-controller
Strong. Object memory is freed at the end of the routine.
id; an object pointer
Dash - Plus sign.
47. The basic steps in custom drawing.
Import / handle multiple inclusion.
UIViewController.
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
Yes. As much as it wants.
48. What about the model and the view talking to one another?
Never!
In the getter! This is called lazy instantiation.
Dash - Plus sign.
Can handle any language because it uses Unicode.
49. What is static typing? Why is it good?
50. Classes cannot have _________ or ___________.
NSSet; no - it's immutable
Yes. As much as it wants.
'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.
Properties; instance variables