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 the center property of a UIView?
2. In a nutshell: how to do custom drawing?
Center of the frame - which is in the superview's coordinate system
At runtime.
Override drawRect:
@synthesize; write our own getter and/or setter.
3. Class methods are used for ___________ and the call starts with ____________.
My rectangle in my superview's coordinate space
An outlet.
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
Two floats - for width and height
4. What is the makeup of a CGPoint?
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
[Object isKindOfClass:[Classname class]]
Two CGFloats for x and y
Instance variable (ivar) or 'backing variable'
5. Some controllers have ____________ as their views.
The document; possibly a database.
No...but it has 'a way' to notify the controller to come ask for fresh data.
Yes. As much as it wants.
Other MVC trios.
6. ______ is a pointer
self
self.view
Points - to achieve device-independence
Interface; Implementation
7. Does a view 'own' the data it displays?
Outlet; Action
NSArray; no - it's immutable.
No...but it has 'a way' to notify the controller to come ask for fresh data.
No - it gets the data from the controller.
8. The controller is always a subclass of...?
iOS; when the view is loaded.
UIViewController.
Import / handle multiple inclusion.
No...but it has 'a way' to notify the controller to come ask for fresh data.
9. What is an example of a reason to write a getter?
Lazy instantiation.
Action
Interface; Implementation
Controls how the model is presented onscreen.
10. ________ is the .h file and __________ is the .m file.
Argument validation.
The compiler adds code to count references.
Interface; Implementation
@synthesize; write our own getter and/or setter.
11. Can the controller talking to the view?
Wrap it in NSValue. And remember that NSValue immutable.
An outlet.
Yes. As much as it wants.
In the getter! This is called lazy instantiation.
12. A _______ is how a view notifies the controller of something - for example - a button press.
'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.'
Instance method; class method.
Action
Interface; Implementation
13. How to access the controller's top view?
(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.
self.view
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
Cocoa Touch - Media - Core Services - Core OS
14. Is it always bad to send messages to id?
15. What if I want to put a scalar into an NSArray or NSSet?
Controls how the model is presented onscreen.
Call setNeedsDisplay:
constant NSString
Wrap it in NSValue. And remember that NSValue immutable.
16. The basic steps in custom drawing.
Never!
create a model
NSData
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
17. When happens when you send a message to nil?
Never!
option-click; option-double-click
Nothing happens - and nil is returned.
Getter and setter methods.
18. How to tell if an object is of a particular class? (Write a line of code)
Instance variable (ivar) or 'backing variable'
Import / handle multiple inclusion.
id; an object pointer
[Object isMemberOfClass:[Classname class]]
19. Remember that it's cool to...
Call setNeedsDisplay:
One; zero to many
line up the colons!
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
20. Use ______ to send debugging messages to the console. Use _____ for any object - which should return an string. Can also use ______.
Cocoa Touch - Media - Core Services - Core OS
NSLog; %@; %d and other formatters
[[UIView alloc] initWithFrame]
NSData
21. In synthesize: @synthesize foo = _foo; The __foo_ is the ____________ or also known as the ___________________.
22. Are local pointers to objects strong or weak? So what happens at the end of the routine?
self.view
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.
Call setNeedsDisplay:
23. How to create a UIView in code?
MVC - for model-view-controller
Two floats - for width and height
Call setNeedsDisplay:
[[UIView alloc] initWithFrame]
24. What is the fundamental design pattern of iOS development?
Introspection - with the class method 'class'
No - it gets the data from the controller.
MVC - for model-view-controller
A framework.
25. How to do enumeration with NSArray - NSDictionary - etc?
26. There is no difference between _____ and _______ at runtime.
Designated initializer.
id; an object pointer
[[UIView alloc] initWithFrame]
Override drawRect:
27. How is ARC done?
The compiler adds code to count references.
Strong. Object memory is freed at the end of the routine.
MVC - for model-view-controller
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
28. What is static typing? Why is it good?
29. The view is...
30. 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];
Override drawRect:
Yes. The controller knows everything about the model.
To zero; so pointers are nil.
31. Instead of 'include' statements - in Objective-C we use _______ which does ________
The compiler adds code to count references.
Instance variable (ivar) or 'backing variable'
Import / handle multiple inclusion.
No. It's fine.
32. What is the word for checking/verifying the type of an object?
33. What is a reason to write our own setter?
Argument validation.
The document; possibly a database.
No - it gets the data from the controller.
NSData
34. What do I use for a bag of bits?
A CGPoint and and a CGSize
NSData
Sort of - in ways that it doesn't need to know much about the controller. For example: delegation.
option-click; option-double-click
35. What about controller talking to the model?
Yes. The controller knows everything about the model.
addSubview; removeFromSubview
Class XX = [Object class]
Designated initializer.
36. What is the name of a property in the controller that it uses to talk to views?
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.
An outlet.
At runtime.
NSLog; %@; %d and other formatters
37. What is the frame property of a UIView?
38. How about the model talking to the controller?
39. How can I save user information between launches of my app?
NSUserDefaults - which stores a property list.
In the getter! This is called lazy instantiation.
self.view
A framework.
40. What is the bounds property of a UIView?
The compiler adds code to count references.
NSLog; %@; %d and other formatters
internal origin and size. Use this inside a view
No - it gets the data from the controller.
41. When is it OK to call drawRect: directly?
Never!
constant NSString
self
Instance variable (ivar) or 'backing variable'
42. How to add subviews in code? How to remove them?
The document; possibly a database.
addSubview; removeFromSubview
Lazy instantiation.
Dash - Plus sign.
43. What do I use for a hash table/associative array? And is it mutable?
44. What is at the top of the view hierarchy?
[Object isKindOfClass:[Classname class]]
for...in; don't change things inside the loop.
UIWindow
Introspection - with the class method 'class'
45. Instance methods start with a ______ and class methods start with a ______.
Two CGFloats for x and y
My rectangle in my superview's coordinate space
Call setNeedsDisplay:
Dash - Plus sign.
46. ______ is a pointer to any object.
id
NSNumber. For example numberWithDouble: and doubleValue:
Controls how the model is presented onscreen.
line up the colons!
47. How to force a redraw of a custom area?
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.
Designated initializer.
Call setNeedsDisplay:
48. What do I use for an ordered collection of objects? And is it mutable?
49. List the iOS hierarchy from top to bottom.
Cocoa Touch - Media - Core Services - Core OS
(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.
NSLog; %@; %d and other formatters
Right-click on view - or even a subview like a button.
50. What is the base class for most objects in the iOS SDK?
iOS; when the view is loaded.
internal origin and size. Use this inside a view
NSObject
Yes. The controller knows everything about the model.