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 decision on what method to call is made when?
NSData
Never!
At runtime.
My rectangle in my superview's coordinate space
2. How is ARC done?
NSData
The compiler adds code to count references.
Dash - Plus sign.
'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.
3. What about the view talking to the controller?
4. Are local pointers to objects strong or weak? So what happens at the end of the routine?
Strong. Object memory is freed at the end of the routine.
NSNumber. For example numberWithDouble: and doubleValue:
id; an object pointer
Getter and setter methods.
5. All classes should have a __________________ to be called by subclasses.
Designated initializer.
NSNumber. For example numberWithDouble: and doubleValue:
id
line up the colons!
6. What is at the top of the view hierarchy?
A rectangular area
UIWindow
UIViewController.
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
7. Instance methods start with a ______ and class methods start with a ______.
Dash - Plus sign.
Getter and setter methods.
Points - to achieve device-independence
Two CGFloats for x and y
8. In the initializer methods of objects I create - add what line of code? Why?
constant NSString
Nothing happens - and nil is returned.
Lazy instantiation.
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.
9. Remember that it's cool to...
Right-click on view - or even a subview like a button.
line up the colons!
Action
Other MVC trios.
10. What do I use for a bag of bits?
One; zero to many
Never!
NSData
@synthesize; write our own getter and/or setter.
11. What is the makeup of a CGPoint?
self.view
constant NSString
Nothing happens - and nil is returned.
Two CGFloats for x and y
12. What is the bounds property of a UIView?
internal origin and size. Use this inside a view
An outlet.
NSSet; no - it's immutable
Two floats - for width and height
13. Show a private interface section.
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
Sort of - in ways that it doesn't need to know much about the controller. For example: delegation.
Other MVC trios.
self
14. Class methods are used for ___________ and the call starts with ____________.
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
Can handle any language because it uses Unicode.
Wrap it in NSValue. And remember that NSValue immutable.
Nothing happens - and nil is returned.
15. How to tell if an object is of a particular class? (Write a line of code)
[[UIView alloc] initWithFrame]
self.view
[Object isMemberOfClass:[Classname class]]
iOS; when the view is loaded.
16. What does a view (UIView) represent?
Other MVC trios.
A rectangular area
self
MVC - for model-view-controller
17. What about public/private in Objective-C?
18. The basic steps in custom drawing.
iOS; when the view is loaded.
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
Class XX = [Object class]
Never!
19. How can I find out the class of any object? Give a line of code.
Nothing happens - and nil is returned.
Class XX = [Object class]
NSDictionary; no - it's immutable.
[Object isKindOfClass:[Classname class]]
20. Why are properties good?
@synthesize; write our own getter and/or setter.
The compiler adds code to count references.
(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.
To zero; so pointers are nil.
21. List the iOS hierarchy from top to bottom.
Cocoa Touch - Media - Core Services - Core OS
My rectangle in my superview's coordinate space
self
Controls how the model is presented onscreen.
22. There is no difference between _____ and _______ at runtime.
id; an object pointer
(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.
No - it gets the data from the controller.
zero/nil
23. Can the controller talking to the view?
A CGPoint and and a CGSize
Yes. As much as it wants.
One; zero to many
NSArray; no - it's immutable.
24. What is the center property of a UIView?
25. How to see all actions - outlets - incoming/outgoing segues on a view?
At runtime.
for...in; don't change things inside the loop.
Right-click on view - or even a subview like a button.
Sort of - in ways that it doesn't need to know much about the controller. For example: delegation.
26. Calling a method on id works just fine because....?
NSArray; no - it's immutable.
The runtime system asks the object what its class is.
Can handle any language because it uses Unicode.
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.
27. In a nutshell: how to do custom drawing?
Import / handle multiple inclusion.
Yes. As much as it wants.
Override drawRect:
No. It's fine.
28. How about the model talking to the controller?
29. What do I use for an ordered collection of objects? And is it mutable?
30. How to instantiate an object?
Properties; instance variables
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
Class XX = [Object class]
31. What does 'weak' mean?
32. What is the base class for most objects in the iOS SDK?
constant NSString
[[UIView alloc] initWithFrame]
NSObject
Controls how the model is presented onscreen.
33. What is a reason to write our own 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.
UIViewController.
constant NSString
Argument validation.
34. How can I save user information between launches of my app?
Interface; Implementation
Call setNeedsDisplay:
NSObject
NSUserDefaults - which stores a property list.
35. Is it always bad to send messages to id?
36. What about controller talking to the model?
Yes. The controller knows everything about the model.
Strongly.
[Class respondsToSelector:@selector(aMethod)]
NSLog; %@; %d and other formatters
37. A _______ is how a view notifies the controller of something - for example - a button press.
Action
'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.
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.
Instance method; class method.
38. What is the fundamental design pattern of iOS development?
Yes. As much as it wants.
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.
NSArray; no - it's immutable.
MVC - for model-view-controller
39. In synthesize: @synthesize foo = _foo; The __foo_ is the ____________ or also known as the ___________________.
40. What is in the model?
A framework.
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.
The document; possibly a database.
Argument validation.
41. What do I use for an unordered collection - e.g. test for membership? And is it mutable?
42. You can send a message to a...
Lazy instantiation.
A rectangular area
constant NSString
Two floats - for width and height
43. Is NSString mutable or not?
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
An outlet.
Getter and setter methods.
Nothing happens - and nil is returned.
44. How to create a UIView in code?
MVC - for model-view-controller
[[UIView alloc] initWithFrame]
No - it gets the data from the controller.
option-click; option-double-click
45. How many superviews does a view have? How many subviews?
No - it gets the data from the controller.
Controls how the model is presented onscreen.
Instance variable (ivar) or 'backing variable'
One; zero to many
46. What do I use for a hash table/associative array? And is it mutable?
47. Is NSArray mutable?
A CGPoint and and a CGSize
iOS; when the view is loaded.
the controller's minions. Gets things to the screen.
No. Use NSMutableArray - which is a subclass of NSArray.
48. What is static typing? Why is it good?
49. When happens when you send a message to nil?
Nothing happens - and nil is returned.
NSDictionary; no - it's immutable.
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
Sort of - in ways that it doesn't need to know much about the controller. For example: delegation.
50. The single-view template in Xcode does not...
Sort of - in ways that it doesn't need to know much about the controller. For example: delegation.
create a model
[Object isKindOfClass:[Classname class]]
One; zero to many