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. Some controllers have ____________ as their views.
Override drawRect:
Other MVC trios.
Can handle any language because it uses Unicode.
Strong. Object memory is freed at the end of the routine.
2. How to force a redraw of a custom area?
Argument validation.
The document; possibly a database.
Call setNeedsDisplay:
Two floats - for width and height
3. In a nutshell: how to do custom drawing?
Controls how the model is presented onscreen.
Lazy instantiation.
NSSet; no - it's immutable
Override drawRect:
4. What is the name of a property in the controller that it uses to talk to views?
'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
The runtime system asks the object what its class is.
An outlet.
5. Show a private interface section.
NSArray; no - it's immutable.
Import / handle multiple inclusion.
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
Yes. As much as it wants.
6. 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
7. What about controller talking to the model?
[[UIView alloc] initWithFrame]
iOS; when the view is loaded.
Yes. The controller knows everything about the model.
On left side - is calling the setter - and on the right side - is calling the getter.
8. Is NSString mutable or not?
Sort of - in ways that it doesn't need to know much about the controller. For example: delegation.
Call setNeedsDisplay:
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
Lazy instantiation.
9. What about public/private in Objective-C?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
10. Talk about BOOL variables.
'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.'
zero/nil
Call setNeedsDisplay:
NO is zero; YES is anything else.
11. What is the base class for most objects in the iOS SDK?
At runtime.
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
NSObject
Getter and setter methods.
12. What is a property list?
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
Two floats - for width and height
NSData
[Class respondsToSelector:@selector(aMethod)]
13. 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.
Class XX = [Object class]
Nothing happens - and nil is returned.
My rectangle in my superview's coordinate space
14. Classes cannot have _________ or ___________.
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
Never!
Instance variable (ivar) or 'backing variable'
Properties; instance variables
15. How to access the controller's top view?
Never!
Outlet; Action
Cocoa Touch - Media - Core Services - Core OS
self.view
16. Objects in an array: are the pointed to strongly or weakly?
NSLog; %@; %d and other formatters
A CGPoint and and a CGSize
Strongly.
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
17. The controller is always a subclass of...?
Strong. Object memory is freed at the end of the routine.
[Class respondsToSelector:@selector(aMethod)]
UIViewController.
option-click; option-double-click
18. What is a reason to write our own setter?
self
Argument validation.
A CGPoint and and a CGSize
Introspection - with the class method 'class'
19. When happens when you send a message to nil?
NO is zero; YES is anything else.
[Class respondsToSelector:@selector(aMethod)]
Nothing happens - and nil is returned.
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
20. 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
21. How are local variables initialized in iOS 5?
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
To zero; so pointers are nil.
NSLog; %@; %d and other formatters
A CGPoint and and a CGSize
22. Instance methods start with a ______ and class methods start with a ______.
id
Dash - Plus sign.
line up the colons!
NSLog; %@; %d and other formatters
23. 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.
Can handle any language because it uses Unicode.
Never!
No - it gets the data from the controller.
24. How to instantiate an object?
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.
A rectangular area
A framework.
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
25. Is NSArray mutable?
Never!
No. Use NSMutableArray - which is a subclass of NSArray.
Override drawRect:
self.view
26. If I need to convert a number to an object - use __________
NSNumber. For example numberWithDouble: and doubleValue:
Yes. The controller knows everything about the model.
A rectangular area
option-click; option-double-click
27. How to see all actions - outlets - incoming/outgoing segues on a view?
On left side - is calling the setter - and on the right side - is calling the getter.
No - it gets the data from the controller.
Right-click on view - or even a subview like a button.
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
28. You can send a message to a...
On left side - is calling the setter - and on the right side - is calling the getter.
Argument validation.
constant NSString
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.
29. What is the iOS term for a library?
A framework.
Introspection - with the class method 'class'
Designated initializer.
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.
30. Why are properties good?
NO is zero; YES is anything else.
NSData
(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.
'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.
31. The view is...
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
32. A _______ goes from the Controller to the View. A ________ goes from the view to the controller.
Strongly.
MVC - for model-view-controller
Outlet; Action
NO is zero; YES is anything else.
33. What is at the top of the view hierarchy?
To zero; so pointers are nil.
Never!
Strongly.
UIWindow
34. How many superviews does a view have? How many subviews?
Getter and setter methods.
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.
NSSet; no - it's immutable
35. The decision on what method to call is made when?
Action
addSubview; removeFromSubview
At runtime.
Never!
36. A property is just the combination of _______.
Getter and setter methods.
On left side - is calling the setter - and on the right side - is calling the getter.
create a model
Outlet; Action
37. There is no difference between _____ and _______ at runtime.
My rectangle in my superview's coordinate space
An outlet.
Two CGFloats for x and y
id; an object pointer
38. How can I save user information between launches of my app?
Yes. As much as it wants.
Designated initializer.
NSUserDefaults - which stores a property list.
NSSet; no - it's immutable
39. What is the makeup of a CGSize?
Two floats - for width and height
No. Use NSMutableArray - which is a subclass of NSArray.
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.
Cocoa Touch - Media - Core Services - Core OS
40. ______ is a pointer
self
iOS; when the view is loaded.
A CGPoint and and a CGSize
NSData
41. What is used in lieu of pixels? And why?
internal origin and size. Use this inside a view
An outlet.
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
Points - to achieve device-independence
42. Dot notation does what?
Cocoa Touch - Media - Core Services - Core OS
Action
On left side - is calling the setter - and on the right side - is calling the getter.
Outlet; Action
43. ________ implements the getter and setter. But we can always__________
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.
@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.
line up the colons!
44. Can the controller talking to the view?
create a model
Yes. As much as it wants.
Nothing happens - and nil is returned.
At runtime.
45. ______ is a pointer to any object.
[Object isKindOfClass:[Classname class]]
Yes. As much as it wants.
id
Override drawRect:
46. 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
47. What do I use for an ordered collection of objects? And is it mutable?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
48. What is the makeup of a CGPoint?
To zero; so pointers are nil.
One; zero to many
Call setNeedsDisplay:
Two CGFloats for x and y
49. 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
50. Are local pointers to objects strong or weak? So what happens at the end of the routine?
zero/nil
A rectangular area
Strong. Object memory is freed at the end of the routine.
Never!