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 basic steps in custom drawing.
Cocoa Touch - Media - Core Services - Core OS
the controller's minions. Gets things to the screen.
self.view
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
2. Remember that it's cool to...
MVC - for model-view-controller
The document; possibly a database.
The runtime system asks the object what its class is.
line up the colons!
3. How to tell whether an object is of a class or class that inherits from that class? (Write a line of code)
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
To zero; so pointers are nil.
[Object isKindOfClass:[Classname class]]
Two CGFloats for x and y
4. The single-view template in Xcode does not...
create a model
Center of the frame - which is in the superview's coordinate system
One; zero to many
iOS; when the view is loaded.
5. What is the center property of a UIView?
6. What is an example of a reason to write a getter?
Lazy instantiation.
Sort of - in ways that it doesn't need to know much about the controller. For example: delegation.
One; zero to many
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.
7. When happens when you send a message to nil?
id; an object pointer
Nothing happens - and nil is returned.
UIWindow
Never!
8. Calling a method on id works just fine because....?
@synthesize; write our own getter and/or setter.
The runtime system asks the object what its class is.
A framework.
Strong. Object memory is freed at the end of the routine.
9. How is ARC done?
'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.'
Action
The compiler adds code to count references.
self.view
10. How many superviews does a view have? How many subviews?
Other MVC trios.
NSLog; %@; %d and other formatters
Interface; Implementation
One; zero to many
11. ________ is the .h file and __________ is the .m file.
Interface; Implementation
Lazy instantiation.
Outlet; Action
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.
12. Show a private interface section.
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
Yes. The controller knows everything about the model.
Controls how the model is presented onscreen.
Can handle any language because it uses Unicode.
13. Instance methods start with a ______ and class methods start with a ______.
addSubview; removeFromSubview
At runtime.
[[UIView alloc] initWithFrame]
Dash - Plus sign.
14. What about the model and the view talking to one another?
Can handle any language because it uses Unicode.
Never!
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
Two floats - for width and height
15. In a nutshell: how to do custom drawing?
NO is zero; YES is anything else.
[Object isMemberOfClass:[Classname class]]
constant NSString
Override drawRect:
16. What if I want to put a scalar into an NSArray or NSSet?
NSData
iOS; when the view is loaded.
self
Wrap it in NSValue. And remember that NSValue immutable.
17. Why are properties good?
NSArray; no - it's immutable.
addSubview; removeFromSubview
(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.
Other MVC trios.
18. What do I use for an unordered collection - e.g. test for membership? And is it mutable?
19. Talk about NSString
internal origin and size. Use this inside a view
Can handle any language because it uses Unicode.
MVC - for model-view-controller
Properties; instance variables
20. How are local variables initialized in iOS 5?
Override drawRect:
UIWindow
To zero; so pointers are nil.
[Object isMemberOfClass:[Classname class]]
21. How to force a redraw of a custom area?
Call setNeedsDisplay:
for...in; don't change things inside the loop.
the controller's minions. Gets things to the screen.
Never!
22. What is used in lieu of pixels? And why?
NSArray; no - it's immutable.
Outlet; Action
for...in; don't change things inside the loop.
Points - to achieve device-independence
23. What do I use for a bag of bits?
NSData
The runtime system asks the object what its class is.
internal origin and size. Use this inside a view
Strong. Object memory is freed at the end of the routine.
24. What is at the top of the view hierarchy?
NO is zero; YES is anything else.
Center of the frame - which is in the superview's coordinate system
Call setNeedsDisplay:
UIWindow
25. How to add subviews in code? How to remove them?
addSubview; removeFromSubview
A framework.
Sort of - in ways that it doesn't need to know much about the controller. For example: delegation.
Getter and setter methods.
26. 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];
self.view
Never!
Import / handle multiple inclusion.
27. What is the fundamental design pattern of iOS development?
self
Class XX = [Object class]
MVC - for model-view-controller
No. It's fine.
28. How to see all actions - outlets - incoming/outgoing segues on a view?
Points - to achieve device-independence
Right-click on view - or even a subview like a button.
internal origin and size. Use this inside a view
[[UIView alloc] initWithFrame]
29. What is a reason to write our own setter?
option-click; option-double-click
Argument validation.
NSNumber. For example numberWithDouble: and doubleValue:
To zero; so pointers are nil.
30. Some controllers have ____________ as their views.
The compiler adds code to count references.
Other MVC trios.
On left side - is calling the setter - and on the right side - is calling the getter.
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
31. Where do I initialize properties?
Argument validation.
Strong. Object memory is freed at the end of the routine.
In the getter! This is called lazy instantiation.
NSArray; no - it's immutable.
32. What does a view (UIView) represent?
[Class respondsToSelector:@selector(aMethod)]
Sort of - in ways that it doesn't need to know much about the controller. For example: delegation.
A rectangular area
To zero; so pointers are nil.
33. What is the makeup of a CGSize?
addSubview; removeFromSubview
Two floats - for width and height
zero/nil
NSDictionary; no - it's immutable.
34. ______ is a pointer
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
Never!
self
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.
35. You can send a message to a...
internal origin and size. Use this inside a view
No...but it has 'a way' to notify the controller to come ask for fresh data.
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.
constant NSString
36. If a method starts with a dash - it's a ___________. If it starts with a plus sign - it's a ______________.
NO is zero; YES is anything else.
Instance method; class method.
Introspection - with the class method 'class'
[Object isMemberOfClass:[Classname class]]
37. How to access the controller's top view?
self.view
id; an object pointer
Properties; instance variables
Strong. Object memory is freed at the end of the routine.
38. What is the iOS term for a library?
Center of the frame - which is in the superview's coordinate system
Strong. Object memory is freed at the end of the routine.
A framework.
NSArray; no - it's immutable.
39. How to do enumeration with NSArray - NSDictionary - etc?
40. How to tell whether an object implements a particular method? (A line of code)
[Class respondsToSelector:@selector(aMethod)]
Nothing happens - and nil is returned.
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
id; an object pointer
41. Can the controller talking to the view?
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.
NSSet; no - it's immutable
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
42. How to tell if an object is of a particular class? (Write a line of code)
Strongly.
[Object isMemberOfClass:[Classname class]]
constant NSString
NSData
43. Is it always bad to send messages to id?
44. How can I save user information between launches of my app?
NSUserDefaults - which stores a property list.
the controller's minions. Gets things to the screen.
MVC - for model-view-controller
addSubview; removeFromSubview
45. What is the base class for most objects in the iOS SDK?
Properties; instance variables
NSObject
MVC - for model-view-controller
The document; possibly a database.
46. Use ______ to send debugging messages to the console. Use _____ for any object - which should return an string. Can also use ______.
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
Interface; Implementation
NSLog; %@; %d and other formatters
NSSet; no - it's immutable
47. Instead of 'include' statements - in Objective-C we use _______ which does ________
Cocoa Touch - Media - Core Services - Core OS
Action
NSLog; %@; %d and other formatters
Import / handle multiple inclusion.
48. The controller is always a subclass of...?
My rectangle in my superview's coordinate space
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
UIViewController.
49. What is a property list?
The document; possibly a database.
Call setNeedsDisplay:
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
the controller's minions. Gets things to the screen.
50. Are local pointers to objects strong or weak? So what happens at the end of the routine?
Yes. As much as it wants.
Strong. Object memory is freed at the end of the routine.
zero/nil
Instance variable (ivar) or 'backing variable'