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 does the controller do?
The compiler adds code to count references.
NSObject
No. It's fine.
Controls how the model is presented onscreen.
2. Talk about NSString
An outlet.
The runtime system asks the object what its class is.
the controller's minions. Gets things to the screen.
Can handle any language because it uses Unicode.
3. Calling a method on id works just fine because....?
No. Use NSMutableArray - which is a subclass of NSArray.
Wrap it in NSValue. And remember that NSValue immutable.
The runtime system asks the object what its class is.
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
4. What is the iOS term for a library?
id; an object pointer
create a model
A framework.
Interface; Implementation
5. What about the model and the view talking to one another?
A rectangular area
An outlet.
Never!
NSArray; no - it's immutable.
6. If a method starts with a dash - it's a ___________. If it starts with a plus sign - it's a ______________.
To zero; so pointers are nil.
'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
Instance method; class method.
7. The decision on what method to call is made when?
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
NSLog; %@; %d and other formatters
addSubview; removeFromSubview
At runtime.
8. What is a reason to write our own setter?
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
Argument validation.
Introspection - with the class method 'class'
Can handle any language because it uses Unicode.
9. The controller is always a subclass of...?
NSUserDefaults - which stores a property list.
Strongly.
zero/nil
UIViewController.
10. How to create a UIView in code?
Action
Other MVC trios.
[[UIView alloc] initWithFrame]
A CGPoint and and a CGSize
11. What about controller talking to the model?
the controller's minions. Gets things to the screen.
Yes. The controller knows everything about the model.
Controls how the model is presented onscreen.
zero/nil
12. All classes should have a __________________ to be called by subclasses.
NO is zero; YES is anything else.
The runtime system asks the object what its class is.
NSObject
Designated initializer.
13. Is NSArray mutable?
internal origin and size. Use this inside a view
Dash - Plus sign.
No. Use NSMutableArray - which is a subclass of NSArray.
for...in; don't change things inside the loop.
14. Why are properties good?
Lazy instantiation.
(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.
Can handle any language because it uses Unicode.
My rectangle in my superview's coordinate space
15. In synthesize: @synthesize foo = _foo; The __foo_ is the ____________ or also known as the ___________________.
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
16. How to tell if an object is of a particular class? (Write a line of code)
Other MVC trios.
MVC - for model-view-controller
Cocoa Touch - Media - Core Services - Core OS
[Object isMemberOfClass:[Classname class]]
17. What is the word for checking/verifying the type of an object?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
18. What is the makeup of a CGRect?
Introspection - with the class method 'class'
Strong. Object memory is freed at the end of the routine.
A CGPoint and and a CGSize
No. It's fine.
19. Class methods are used for ___________ and the call starts with ____________.
Strongly.
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
The compiler adds code to count references.
NSLog; %@; %d and other formatters
20. Instead of 'include' statements - in Objective-C we use _______ which does ________
Import / handle multiple inclusion.
To zero; so pointers are nil.
Two floats - for width and height
NSSet; no - it's immutable
21. What does a view (UIView) represent?
A rectangular area
Properties; instance variables
[Object isMemberOfClass:[Classname class]]
Right-click on view - or even a subview like a button.
22. The basic steps in custom drawing.
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
Never!
the controller's minions. Gets things to the screen.
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
23. Objects in an array: are the pointed to strongly or weakly?
Strongly.
iOS; when the view is loaded.
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
Argument validation.
24. Classes cannot have _________ or ___________.
On left side - is calling the setter - and on the right side - is calling the getter.
id; an object pointer
Properties; instance variables
Other MVC trios.
25. How to tell whether an object is of a class or class that inherits from that class? (Write a line of code)
NSNumber. For example numberWithDouble: and doubleValue:
UIWindow
[Object isKindOfClass:[Classname class]]
To zero; so pointers are nil.
26. A _______ goes from the Controller to the View. A ________ goes from the view to the controller.
Import / handle multiple inclusion.
self
Outlet; Action
for...in; don't change things inside the loop.
27. A _______ is how a view notifies the controller of something - for example - a button press.
Instance variable (ivar) or 'backing variable'
Other MVC trios.
No. It's fine.
Action
28. How can I save user information between launches of my app?
addSubview; removeFromSubview
NSUserDefaults - which stores a property list.
zero/nil
Never!
29. How many superviews does a view have? How many subviews?
Controls how the model is presented onscreen.
One; zero to many
constant NSString
Sort of - in ways that it doesn't need to know much about the controller. For example: delegation.
30. ______ is a pointer
Sort of - in ways that it doesn't need to know much about the controller. For example: delegation.
[[UIView alloc] initWithFrame]
self
Never!
31. What is static typing? Why is it good?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
32. What is the bounds property of a UIView?
At runtime.
internal origin and size. Use this inside a view
No. It's fine.
self.view
33. What is used in lieu of pixels? And why?
Points - to achieve device-independence
Instance variable (ivar) or 'backing variable'
Strongly.
The runtime system asks the object what its class is.
34. You can send a message to a...
NO is zero; YES is anything else.
constant NSString
NSArray; no - it's immutable.
Cocoa Touch - Media - Core Services - Core OS
35. What is an example of a reason to write a getter?
Never!
Lazy instantiation.
internal origin and size. Use this inside a view
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
36. Use ______ to send debugging messages to the console. Use _____ for any object - which should return an string. Can also use ______.
UIWindow
Two CGFloats for x and y
addSubview; removeFromSubview
NSLog; %@; %d and other formatters
37. How to access the controller's top view?
NSLog; %@; %d and other formatters
iOS; when the view is loaded.
MVC - for model-view-controller
self.view
38. How is ARC done?
The compiler adds code to count references.
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.
Never!
Yes. As much as it wants.
39. What if I want to put a scalar into an NSArray or NSSet?
Wrap it in NSValue. And remember that NSValue immutable.
Interface; Implementation
A rectangular area
Introspection - with the class method 'class'
40. All properties are initialized to _____
Properties; instance variables
Instance method; class method.
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.
zero/nil
41. If I need to convert a number to an object - use __________
NSData
Argument validation.
NSNumber. For example numberWithDouble: and doubleValue:
NSSet; no - it's immutable
42. There is no difference between _____ and _______ at runtime.
id; an object pointer
Class XX = [Object class]
[Object isKindOfClass:[Classname class]]
Never!
43. How to add subviews in code? How to remove them?
addSubview; removeFromSubview
Introspection - with the class method 'class'
the controller's minions. Gets things to the screen.
Strongly.
44. 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.
addSubview; removeFromSubview
Action
Yes. As much as it wants.
45. What is the makeup of a CGSize?
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
Interface; Implementation
Two floats - for width and height
NSSet; no - it's immutable
46. What is the base class for most objects in the iOS SDK?
Never!
No - it gets the data from the controller.
NSObject
The runtime system asks the object what its class is.
47. List the iOS hierarchy from top to bottom.
In the getter! This is called lazy instantiation.
self.view
Cocoa Touch - Media - Core Services - Core OS
Instance method; class method.
48. What is the center property of a UIView?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
49. How to do enumeration with NSArray - NSDictionary - etc?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
50. What about the view talking to the controller?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183