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. Classes cannot have _________ or ___________.
'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.
Properties; instance variables
An outlet.
id; an object pointer
2. The setters for outlets are called by _______ at this point ______________.
iOS; when the view is loaded.
UIViewController.
Cocoa Touch - Media - Core Services - Core OS
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
3. What do I use for a bag of bits?
NSData
[Object isMemberOfClass:[Classname class]]
No - it gets the data from the controller.
[Object isKindOfClass:[Classname class]]
4. How to add subviews in code? How to remove them?
NSObject
[[UIView alloc] initWithFrame]
@synthesize; write our own getter and/or setter.
addSubview; removeFromSubview
5. What is in the model?
Instance method; class method.
No. It's fine.
Right-click on view - or even a subview like a button.
The document; possibly a database.
6. What if I want to put a scalar into an NSArray or NSSet?
NO is zero; YES is anything else.
Wrap it in NSValue. And remember that NSValue immutable.
MVC - for model-view-controller
NSLog; %@; %d and other formatters
7. What to do in Xcode for short documentation? For full documentation?
addSubview; removeFromSubview
option-click; option-double-click
Strong. Object memory is freed at the end of the routine.
id; an object pointer
8. Is NSString mutable or not?
the controller's minions. Gets things to the screen.
Points - to achieve device-independence
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.
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
9. How can I find out the class of any object? Give a line of code.
Interface; Implementation
Strong. Object memory is freed at the end of the routine.
The compiler adds code to count references.
Class XX = [Object class]
10. Does a view 'own' the data it displays?
No - it gets the data from the controller.
[Class respondsToSelector:@selector(aMethod)]
Nothing happens - and nil is returned.
@synthesize; write our own getter and/or setter.
11. When is it OK to call drawRect: directly?
Properties; instance variables
Never!
option-click; option-double-click
Two floats - for width and height
12. ________ is the .h file and __________ is the .m file.
NSSet; no - it's immutable
option-click; option-double-click
In the getter! This is called lazy instantiation.
Interface; Implementation
13. The decision on what method to call is made when?
for...in; don't change things inside the loop.
line up the colons!
Never!
At runtime.
14. Are local pointers to objects strong or weak? So what happens at the end of the routine?
NSSet; no - it's immutable
Strong. Object memory is freed at the end of the routine.
[Object isKindOfClass:[Classname class]]
Import / handle multiple inclusion.
15. How is ARC done?
Properties; instance variables
The compiler adds code to count references.
To zero; so pointers are nil.
Strong. Object memory is freed at the end of the routine.
16. What does 'weak' mean?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
17. There is no difference between _____ and _______ at runtime.
At runtime.
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.
id; an object pointer
The compiler adds code to count references.
18. What is an example of a reason to write a getter?
On left side - is calling the setter - and on the right side - is calling the getter.
the controller's minions. Gets things to the screen.
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
Lazy instantiation.
19. What is a property list?
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
NSArray; no - it's immutable.
To zero; so pointers are nil.
[Object isMemberOfClass:[Classname class]]
20. List the iOS hierarchy from top to bottom.
Cocoa Touch - Media - Core Services - Core OS
UIWindow
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
'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.
21. What does 'strong' mean?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
22. All classes should have a __________________ to be called by subclasses.
Designated initializer.
On left side - is calling the setter - and on the right side - is calling the getter.
id; an object pointer
In the getter! This is called lazy instantiation.
23. 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
24. The view is...
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
25. What is the bounds property of a UIView?
Action
internal origin and size. Use this inside a view
option-click; option-double-click
No. It's fine.
26. What do I use for an unordered collection - e.g. test for membership? And is it mutable?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
27. Is NSArray mutable?
Strong. Object memory is freed at the end of the routine.
No. Use NSMutableArray - which is a subclass of NSArray.
Other MVC trios.
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.
28. When happens when you send a message to nil?
Nothing happens - and nil is returned.
A framework.
iOS; when the view is loaded.
'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.'
29. What is at the top of the view hierarchy?
'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.'
UIWindow
A framework.
Getter and setter methods.
30. What is the makeup of a CGPoint?
No - it gets the data from the controller.
Two CGFloats for x and y
A rectangular area
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
31. 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
32. 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.
The compiler adds code to count references.
[Class respondsToSelector:@selector(aMethod)]
UIViewController.
33. If I need to convert a number to an object - use __________
The document; possibly a database.
Getter and setter methods.
for...in; don't change things inside the loop.
NSNumber. For example numberWithDouble: and doubleValue:
34. 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
35. All properties are initialized to _____
[[UIView alloc] initWithFrame]
zero/nil
NSUserDefaults - which stores a property list.
for...in; don't change things inside the loop.
36. How are local variables initialized in iOS 5?
Right-click on view - or even a subview like a button.
To zero; so pointers are nil.
Interface; Implementation
NSDictionary; no - it's immutable.
37. How to force a redraw of a custom area?
constant NSString
Other MVC trios.
Strong. Object memory is freed at the end of the routine.
Call setNeedsDisplay:
38. Can the controller talking to the view?
No. It's fine.
Yes. As much as it wants.
id; an object pointer
An outlet.
39. Objects in an array: are the pointed to strongly or weakly?
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
[Object isMemberOfClass:[Classname class]]
Strongly.
Other MVC trios.
40. Talk about BOOL variables.
NO is zero; YES is anything else.
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
Instance variable (ivar) or 'backing variable'
NSNumber. For example numberWithDouble: and doubleValue:
41. What is the makeup of a CGSize?
Two floats - for width and height
Nothing happens - and nil is returned.
NO is zero; YES is anything else.
In the getter! This is called lazy instantiation.
42. A _______ goes from the Controller to the View. A ________ goes from the view to the controller.
Outlet; Action
Can handle any language because it uses Unicode.
Points - to achieve device-independence
The compiler adds code to count references.
43. How to tell if an object is of a particular class? (Write a line of code)
iOS; when the view is loaded.
[Object isMemberOfClass:[Classname class]]
Instance variable (ivar) or 'backing variable'
UIViewController.
44. 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
45. 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
46. ______ is a pointer
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.
self
NSArray; no - it's immutable.
'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.'
47. Dot notation does what?
On left side - is calling the setter - and on the right side - is calling the getter.
UIWindow
internal origin and size. Use this inside a view
Lazy instantiation.
48. How many superviews does a view have? How many subviews?
Right-click on view - or even a subview like a button.
NSSet; no - it's immutable
One; zero to many
constant NSString
49. What about the model and the view talking to one another?
NSData
No...but it has 'a way' to notify the controller to come ask for fresh data.
Cocoa Touch - Media - Core Services - Core OS
Never!
50. 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.
id; an object pointer
Never!
Import / handle multiple inclusion.