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. 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.
In the getter! This is called lazy instantiation.
Introspection - with the class method 'class'
NSLog; %@; %d and other formatters
2. How to see all actions - outlets - incoming/outgoing segues on a view?
Right-click on view - or even a subview like a button.
id; an object pointer
Properties; instance variables
Two floats - for width and height
3. What is the iOS term for a library?
Sort of - in ways that it doesn't need to know much about the controller. For example: delegation.
Action
A framework.
Instance variable (ivar) or 'backing variable'
4. What does the controller do?
Controls how the model is presented onscreen.
Properties; instance variables
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
NSObject
5. How are local variables initialized in iOS 5?
Override drawRect:
To zero; so pointers are nil.
NSSet; no - it's immutable
NSNumber. For example numberWithDouble: and doubleValue:
6. All classes should have a __________________ to be called by subclasses.
The compiler adds code to count references.
UIViewController.
UIWindow
Designated initializer.
7. ______ is a pointer to any object.
id
Center of the frame - which is in the superview's coordinate system
Never!
id; an object pointer
8. Instance methods start with a ______ and class methods start with a ______.
for...in; don't change things inside the loop.
Dash - Plus sign.
Yes. As much as it wants.
line up the colons!
9. Talk about NSString
NSLog; %@; %d and other formatters
[Object isKindOfClass:[Classname class]]
Yes. As much as it wants.
Can handle any language because it uses Unicode.
10. What is at the top of the view hierarchy?
addSubview; removeFromSubview
UIWindow
@synthesize; write our own getter and/or setter.
Yes. As much as it wants.
11. What is the word for checking/verifying the type of an object?
12. What is the frame property of a UIView?
13. In synthesize: @synthesize foo = _foo; The __foo_ is the ____________ or also known as the ___________________.
14. What do I use for a hash table/associative array? And is it mutable?
15. When happens when you send a message to nil?
Controls how the model is presented onscreen.
Yes. The controller knows everything about the model.
Nothing happens - and nil is returned.
At runtime.
16. A _______ goes from the Controller to the View. A ________ goes from the view to the controller.
Strong. Object memory is freed at the end of the routine.
the controller's minions. Gets things to the screen.
Outlet; Action
Properties; instance variables
17. A _______ is how a view notifies the controller of something - for example - a button press.
Action
At runtime.
A rectangular area
id
18. What is the center property of a UIView?
19. If I need to convert a number to an object - use __________
NSNumber. For example numberWithDouble: and doubleValue:
Designated initializer.
No. It's fine.
Can handle any language because it uses Unicode.
20. What about public/private in Objective-C?
21. Does a view 'own' the data it displays?
No - it gets the data from the controller.
Two floats - for width and height
Outlet; Action
NO is zero; YES is anything else.
22. In a nutshell: how to do custom drawing?
'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.
On left side - is calling the setter - and on the right side - is calling the getter.
Override drawRect:
No...but it has 'a way' to notify the controller to come ask for fresh data.
23. What is the bounds property of a UIView?
internal origin and size. Use this inside a 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.
Strongly.
No - it gets the data from the controller.
24. The decision on what method to call is made when?
Class XX = [Object class]
At runtime.
Other MVC trios.
One; zero to many
25. The view is...
26. Remember that it's cool to...
line up the colons!
NO is zero; YES is anything else.
NSUserDefaults - which stores a property list.
[Class respondsToSelector:@selector(aMethod)]
27. A property is just the combination of _______.
Getter and setter methods.
UIWindow
Two floats - for width and height
Sort of - in ways that it doesn't need to know much about the controller. For example: delegation.
28. When is it OK to call drawRect: directly?
Designated initializer.
Never!
iOS; when the view is loaded.
Import / handle multiple inclusion.
29. How many superviews does a view have? How many subviews?
UIViewController.
No. It's fine.
UIWindow
One; zero to many
30. Some controllers have ____________ as their views.
Other MVC trios.
create a model
constant NSString
'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.
31. How to add subviews in code? How to remove them?
addSubview; removeFromSubview
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
NO is zero; YES is anything else.
NSData
32. All properties are initialized to _____
Call setNeedsDisplay:
A framework.
zero/nil
Dash - Plus sign.
33. What is an example of a reason to write a getter?
Instance variable (ivar) or 'backing variable'
My rectangle in my superview's coordinate space
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.
34. You can send a message to a...
Center of the frame - which is in the superview's coordinate system
Lazy instantiation.
Call setNeedsDisplay:
constant NSString
35. What is in the model?
Two CGFloats for x and y
The document; possibly a database.
(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.
Right-click on view - or even a subview like a button.
36. What is a property list?
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
The document; possibly a database.
The compiler adds code to count references.
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.
37. What if I want to put a scalar into an NSArray or NSSet?
Instance variable (ivar) or 'backing variable'
Wrap it in NSValue. And remember that NSValue immutable.
Right-click on view - or even a subview like a button.
Two floats - for width and height
38. How to tell whether an object implements a particular method? (A line of code)
[Class respondsToSelector:@selector(aMethod)]
Instance variable (ivar) or 'backing variable'
Interface; Implementation
On left side - is calling the setter - and on the right side - is calling the getter.
39. 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]]
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
(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.
UIViewController.
40. 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.
Instance method; class method.
Never!
Interface; Implementation
41. How can I save user information between launches of my app?
option-click; option-double-click
The document; possibly a database.
NSData
NSUserDefaults - which stores a property list.
42. What is the fundamental design pattern of iOS development?
NSSet; no - it's immutable
UIViewController.
Other MVC trios.
MVC - for model-view-controller
43. How is ARC done?
Outlet; Action
The compiler adds code to count references.
NSUserDefaults - which stores a property list.
Lazy instantiation.
44. The basic steps in custom drawing.
Argument validation.
The compiler adds code to count references.
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
(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.
45. Dot notation does what?
A rectangular area
zero/nil
On left side - is calling the setter - and on the right side - is calling the getter.
iOS; when the view is loaded.
46. What is the makeup of a CGPoint?
On left side - is calling the setter - and on the right side - is calling the getter.
self.view
MVC - for model-view-controller
Two CGFloats for x and y
47. How to do enumeration with NSArray - NSDictionary - etc?
48. What is static typing? Why is it good?
49. If a method starts with a dash - it's a ___________. If it starts with a plus sign - it's a ______________.
My rectangle in my superview's coordinate space
Instance method; class method.
[Object isKindOfClass:[Classname class]]
create a model
50. How can I find out the class of any object? Give a line of code.
Class XX = [Object class]
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
Yes. The controller knows everything about the model.
An outlet.