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. Instead of 'include' statements - in Objective-C we use _______ which does ________
A framework.
No - it gets the data from the controller.
Yes. The controller knows everything about the model.
Import / handle multiple inclusion.
2. How many superviews does a view have? How many subviews?
NSUserDefaults - which stores a property list.
One; zero to many
NSNumber. For example numberWithDouble: and doubleValue:
self.view
3. How to do enumeration with NSArray - NSDictionary - etc?
4. What does 'weak' mean?
5. The single-view template in Xcode does not...
No. It's fine.
Import / handle multiple inclusion.
Never!
create a model
6. What is static typing? Why is it good?
7. All classes should have a __________________ to be called by subclasses.
Cocoa Touch - Media - Core Services - Core OS
Designated initializer.
Wrap it in NSValue. And remember that NSValue immutable.
[[UIView alloc] initWithFrame]
8. What about controller talking to the model?
'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.
[Class respondsToSelector:@selector(aMethod)]
Yes. The controller knows everything about the model.
Designated initializer.
9. Is NSArray mutable?
(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
No. Use NSMutableArray - which is a subclass of NSArray.
[Object isMemberOfClass:[Classname class]]
10. How to see all actions - outlets - incoming/outgoing segues on a view?
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.
Points - to achieve device-independence
Yes. The controller knows everything about the model.
Right-click on view - or even a subview like a button.
11. What do I use for an unordered collection - e.g. test for membership? And is it mutable?
12. What is the makeup of a CGSize?
Getter and setter methods.
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...but it has 'a way' to notify the controller to come ask for fresh data.
Two floats - for width and height
13. List the iOS hierarchy from top to bottom.
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
[Class respondsToSelector:@selector(aMethod)]
Two CGFloats for x and y
Cocoa Touch - Media - Core Services - Core OS
14. What do I use for a hash table/associative array? And is it mutable?
15. A _______ is how a view notifies the controller of something - for example - a button press.
UIWindow
addSubview; removeFromSubview
zero/nil
Action
16. Can the controller talking to the view?
One; zero to many
Yes. As much as it wants.
No. It's fine.
[[UIView alloc] initWithFrame]
17. Objects in an array: are the pointed to strongly or weakly?
Strongly.
At runtime.
(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.
'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.
18. Is it always bad to send messages to id?
19. What is the frame property of a UIView?
20. What is the base class for most objects in the iOS SDK?
constant NSString
Outlet; Action
MVC - for model-view-controller
NSObject
21. What is at the top of the view hierarchy?
self.view
At runtime.
UIWindow
Wrap it in NSValue. And remember that NSValue immutable.
22. ________ implements the getter and setter. But we can always__________
Call setNeedsDisplay:
zero/nil
NSObject
@synthesize; write our own getter and/or setter.
23. ______ is a pointer
@synthesize; write our own getter and/or setter.
Center of the frame - which is in the superview's coordinate system
self
addSubview; removeFromSubview
24. A _______ goes from the Controller to the View. A ________ goes from the view to the controller.
No. It's fine.
Lazy instantiation.
Center of the frame - which is in the superview's coordinate system
Outlet; Action
25. Where do I initialize properties?
The runtime system asks the object what its class is.
In the getter! This is called lazy instantiation.
A framework.
NSUserDefaults - which stores a property list.
26. How to tell whether an object implements a particular method? (A line of code)
On left side - is calling the setter - and on the right side - is calling the getter.
My rectangle in my superview's coordinate space
Import / handle multiple inclusion.
[Class respondsToSelector:@selector(aMethod)]
27. Talk about NSString
self
[Object isMemberOfClass:[Classname class]]
Can handle any language because it uses Unicode.
An outlet.
28. How to force a redraw of a custom area?
The document; possibly a database.
Designated initializer.
Call setNeedsDisplay:
NSLog; %@; %d and other formatters
29. When happens when you send a message to nil?
Import / handle multiple inclusion.
Sort of - in ways that it doesn't need to know much about the controller. For example: delegation.
Nothing happens - and nil is returned.
A rectangular area
30. In synthesize: @synthesize foo = _foo; The __foo_ is the ____________ or also known as the ___________________.
31. There is no difference between _____ and _______ at runtime.
Right-click on view - or even a subview like a button.
id; an object pointer
Lazy instantiation.
No...but it has 'a way' to notify the controller to come ask for fresh data.
32. What about public/private in Objective-C?
33. What is in the model?
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
Outlet; Action
The document; possibly a database.
@synthesize; write our own getter and/or setter.
34. What does 'strong' mean?
35. Are local pointers to objects strong or weak? So what happens at the end of the routine?
option-click; option-double-click
NSSet; no - it's immutable
Strong. Object memory is freed at the end of the routine.
Import / handle multiple inclusion.
36. Instance methods start with a ______ and class methods start with a ______.
Points - to achieve device-independence
To zero; so pointers are nil.
Can handle any language because it uses Unicode.
Dash - Plus sign.
37. Calling a method on id works just fine because....?
[[UIView alloc] initWithFrame]
Strong. Object memory is freed at the end of the routine.
The runtime system asks the object what its class is.
option-click; option-double-click
38. What is the fundamental design pattern of iOS development?
Action
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
MVC - for model-view-controller
NO is zero; YES is anything else.
39. What is the bounds property of a UIView?
internal origin and size. Use this inside a view
Instance method; class method.
self
One; zero to many
40. Dot notation does what?
The runtime system asks the object what its class is.
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.
On left side - is calling the setter - and on the right side - is calling the getter.
41. What is a reason to write our own setter?
Action
Introspection - with the class method 'class'
Argument validation.
To zero; so pointers are nil.
42. The view is...
43. How to create a UIView in code?
Never!
[[UIView alloc] initWithFrame]
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
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.
44. The basic steps in custom drawing.
Other MVC trios.
Sort of - in ways that it doesn't need to know much about the controller. For example: delegation.
self
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
45. How to access the controller's top view?
UIWindow
self.view
addSubview; removeFromSubview
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.
46. What is an example of a reason to write a getter?
[[UIView alloc] initWithFrame]
Strong. Object memory is freed at the end of the routine.
Designated initializer.
Lazy instantiation.
47. How is ARC done?
The compiler adds code to count references.
Import / handle multiple inclusion.
the controller's minions. Gets things to the screen.
option-click; option-double-click
48. You can send a message to a...
Properties; instance variables
constant NSString
The document; possibly a database.
Wrap it in NSValue. And remember that NSValue immutable.
49. Use ______ to send debugging messages to the console. Use _____ for any object - which should return an string. Can also use ______.
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.
NSSet; no - it's immutable
NSLog; %@; %d and other formatters
Cocoa Touch - Media - Core Services - Core OS
50. In the initializer methods of objects I create - add what line of code? Why?
The compiler adds code to count references.
NSNumber. For example numberWithDouble: and doubleValue:
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.
NSSet; no - it's immutable