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 'strong' mean?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
2. Where do I initialize properties?
option-click; option-double-click
A framework.
In the getter! This is called 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.
3. ______ is a pointer
Instance method; class method.
My rectangle in my superview's coordinate space
self
[Object isKindOfClass:[Classname class]]
4. In the initializer methods of objects I create - add what line of code? Why?
UIViewController.
Center of the frame - which is in the superview's coordinate system
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.
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
5. What about the model and the view talking to one another?
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.
Never!
Class XX = [Object class]
[Class respondsToSelector:@selector(aMethod)]
6. Some controllers have ____________ as their views.
Other MVC trios.
Call setNeedsDisplay:
[Object isMemberOfClass:[Classname class]]
Strong. Object memory is freed at the end of the routine.
7. How is ARC done?
Call setNeedsDisplay:
The compiler adds code to count references.
In the getter! This is called lazy instantiation.
A CGPoint and and a CGSize
8. What if I want to put a scalar into an NSArray or NSSet?
Right-click on view - or even a subview like a button.
Wrap it in NSValue. And remember that NSValue immutable.
No...but it has 'a way' to notify the controller to come ask for fresh data.
In the getter! This is called lazy instantiation.
9. There is no difference between _____ and _______ at runtime.
A framework.
The runtime system asks the object what its class is.
id; an object pointer
NSUserDefaults - which stores a property list.
10. A _______ is how a view notifies the controller of something - for example - a button press.
Dash - Plus sign.
internal origin and size. Use this inside a view
id
Action
11. What do I use for a hash table/associative array? And is it mutable?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
12. What does the controller do?
Points - to achieve device-independence
No...but it has 'a way' to notify the controller to come ask for fresh data.
Yes. As much as it wants.
Controls how the model is presented onscreen.
13. In a nutshell: how to do custom drawing?
MVC - for model-view-controller
for...in; don't change things inside the loop.
NSObject
Override drawRect:
14. How to instantiate an object?
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
[[UIView alloc] initWithFrame]
'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.
Lazy instantiation.
15. How to access the controller's top view?
Can handle any language because it uses Unicode.
line up the colons!
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
self.view
16. Talk about NSString
NSDictionary; no - it's immutable.
constant NSString
Can handle any language because it uses Unicode.
Cocoa Touch - Media - Core Services - Core OS
17. What is the fundamental design pattern of iOS development?
Sort of - in ways that it doesn't need to know much about the controller. For example: delegation.
Two CGFloats for x and y
NSDictionary; no - it's immutable.
MVC - for model-view-controller
18. What to do in Xcode for short documentation? For full documentation?
No. Use NSMutableArray - which is a subclass of NSArray.
Dash - Plus sign.
id
option-click; option-double-click
19. When is it OK to call drawRect: directly?
addSubview; removeFromSubview
Wrap it in NSValue. And remember that NSValue immutable.
Never!
Override drawRect:
20. Instance methods start with a ______ and class methods start with a ______.
Dash - Plus sign.
Lazy instantiation.
Other MVC trios.
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
21. What is the makeup of a CGPoint?
An outlet.
Instance method; class method.
Two CGFloats for x and y
In the getter! This is called lazy instantiation.
22. What do I use for a bag of bits?
NSData
One; zero to many
NO is zero; YES is anything else.
iOS; when the view is loaded.
23. The view is...
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
24. What is at the top of the view hierarchy?
Override drawRect:
NSObject
UIWindow
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.
25. What is the makeup of a CGSize?
To zero; so pointers are nil.
Two floats - for width and height
'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.'
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.
26. ________ is the .h file and __________ is the .m file.
Interface; Implementation
Outlet; Action
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
A CGPoint and and a CGSize
27. What is the name of a property in the controller that it uses to talk to views?
An outlet.
NSUserDefaults - which stores a property list.
(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.
Strong. Object memory is freed at the end of the routine.
28. How are local variables initialized in iOS 5?
NSDictionary; no - it's immutable.
NSData
@synthesize; write our own getter and/or setter.
To zero; so pointers are nil.
29. Calling a method on id works just fine because....?
Class XX = [Object class]
@synthesize; write our own getter and/or setter.
The runtime system asks the object what its class is.
(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.
30. What is a property list?
Right-click on view - or even a subview like a button.
id; an object pointer
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
Never!
31. How can I save user information between launches of my app?
Outlet; Action
NSArray; no - it's immutable.
NSUserDefaults - which stores a property list.
[Object isKindOfClass:[Classname class]]
32. How to tell whether an object is of a class or class that inherits from that class? (Write a line of code)
Sort of - in ways that it doesn't need to know much about the controller. For example: delegation.
A framework.
Designated initializer.
[Object isKindOfClass:[Classname class]]
33. All properties are initialized to _____
Yes. As much as it wants.
Override drawRect:
zero/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.
34. The decision on what method to call is made when?
Argument validation.
Two CGFloats for x and y
Dash - Plus sign.
At runtime.
35. Classes cannot have _________ or ___________.
Properties; instance variables
Strongly.
An outlet.
Two floats - for width and height
36. What is the base class for most objects in the iOS SDK?
Class XX = [Object 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.'
NSData
NSObject
37. What is in the model?
The document; possibly a database.
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.
Center of the frame - which is in the superview's coordinate system
38. Is NSArray mutable?
No. Use NSMutableArray - which is a subclass of NSArray.
zero/nil
NSObject
Strongly.
39. Show a private interface section.
The runtime system asks the object what its class is.
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
Getter and setter methods.
40. 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
41. 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
42. Class methods are used for ___________ and the call starts with ____________.
Wrap it in NSValue. And remember that NSValue immutable.
(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.
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
My rectangle in my superview's coordinate space
43. ________ implements the getter and setter. But we can always__________
Strong. Object memory is freed at the end of the routine.
@synthesize; write our own getter and/or setter.
A framework.
self
44. Talk about BOOL variables.
An outlet.
Right-click on view - or even a subview like a button.
A rectangular area
NO is zero; YES is anything else.
45. What is an example of a reason to write a getter?
MVC - for model-view-controller
Lazy instantiation.
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.
On left side - is calling the setter - and on the right side - is calling the getter.
46. Can the controller talking to the view?
NSNumber. For example numberWithDouble: and doubleValue:
Cocoa Touch - Media - Core Services - Core OS
Yes. As much as it wants.
On left side - is calling the setter - and on the right side - is calling the getter.
47. How to force a redraw of a custom area?
Call setNeedsDisplay:
Properties; instance variables
@synthesize; write our own getter and/or setter.
Designated initializer.
48. 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
49. How about the model talking to the controller?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
50. What does a view (UIView) represent?
zero/nil
Points - to achieve device-independence
Lazy instantiation.
A rectangular area