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