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