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