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 is the frame property of a UIView?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
2. Why are properties good?
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.
Never!
zero/nil
(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. The decision on what method to call is made when?
In the getter! This is called lazy instantiation.
No. Use NSMutableArray - which is a subclass of NSArray.
Controls how the model is presented onscreen.
At runtime.
4. How to instantiate an object?
My rectangle in my superview's coordinate space
UIViewController.
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.
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
5. 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
6. Talk about 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.
A rectangular area
Never!
Can handle any language because it uses Unicode.
7. 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.
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
NSSet; no - it's immutable
NSArray; no - it's immutable.
8. Can the controller talking to the view?
No - it gets the data from the controller.
Override drawRect:
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
Yes. As much as it wants.
9. Show a private interface section.
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
Interface; Implementation
zero/nil
10. What is the bounds property of a UIView?
Designated initializer.
NSData
internal origin and size. Use this inside a view
UIViewController.
11. 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
12. Where do I initialize properties?
Sort of - in ways that it doesn't need to know much about the controller. For example: delegation.
In the getter! This is called lazy instantiation.
Yes. The controller knows everything about the model.
A CGPoint and and a CGSize
13. What is a reason to write our own setter?
Instance variable (ivar) or 'backing variable'
(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.
Argument validation.
14. 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
15. How is ARC done?
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.
Two CGFloats for x and y
The compiler adds code to count references.
No. It's fine.
16. How are local variables initialized in iOS 5?
To zero; so pointers are nil.
The document; possibly a database.
Call setNeedsDisplay:
Yes. The controller knows everything about the model.
17. What is at the top of the view hierarchy?
Strong. Object memory is freed at the end of the routine.
UIWindow
Strongly.
NSData
18. What does 'strong' mean?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
19. What is the makeup of a CGPoint?
Two CGFloats for x and y
Yes. The controller knows everything about the model.
Class XX = [Object class]
Dash - Plus sign.
20. How to tell if an object is of a particular class? (Write a line of code)
My rectangle in my superview's coordinate space
[Object isMemberOfClass:[Classname class]]
[[UIView alloc] initWithFrame]
self.view
21. The single-view template in Xcode does not...
The document; possibly a database.
create a model
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 CGPoint and and a CGSize
22. 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.
UIWindow
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
Center of the frame - which is in the superview's coordinate system
23. ________ is the .h file and __________ is the .m file.
Interface; Implementation
[[UIView alloc] initWithFrame]
Wrap it in NSValue. And remember that NSValue immutable.
@synthesize; write our own getter and/or setter.
24. How to tell whether an object is of a class or class that inherits from that class? (Write a line of code)
On left side - is calling the setter - and on the right side - is calling the getter.
[Object isKindOfClass:[Classname class]]
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.
25. What is in the model?
A CGPoint and and a CGSize
NO is zero; YES is anything else.
The document; possibly a database.
option-click; option-double-click
26. Talk about BOOL variables.
[Object isMemberOfClass:[Classname class]]
Instance variable (ivar) or 'backing variable'
'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.'
NO is zero; YES is anything else.
27. Is it always bad to send messages to id?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
28. If a method starts with a dash - it's a ___________. If it starts with a plus sign - it's a ______________.
Instance method; class method.
Never!
On left side - is calling the setter - and on the right side - is calling the getter.
Instance variable (ivar) or 'backing variable'
29. ______ is a pointer
'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.
To zero; so pointers are nil.
self
for...in; don't change things inside the loop.
30. Use ______ to send debugging messages to the console. Use _____ for any object - which should return an string. Can also use ______.
Dash - Plus sign.
NSLog; %@; %d and other formatters
No. It's fine.
option-click; option-double-click
31. What is the makeup of a CGSize?
option-click; option-double-click
NSLog; %@; %d and other formatters
Class XX = [Object class]
Two floats - for width and height
32. What is an example of a reason to write a getter?
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
Introspection - with the class method 'class'
[[UIView alloc] initWithFrame]
Lazy instantiation.
33. When is it OK to call drawRect: directly?
NO is zero; YES is anything else.
NSNumber. For example numberWithDouble: and doubleValue:
Never!
MVC - for model-view-controller
34. In a nutshell: how to do custom drawing?
No...but it has 'a way' to notify the controller to come ask for fresh data.
Override drawRect:
Center of the frame - which is in the superview's coordinate system
(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.
35. What is used in lieu of pixels? And why?
NSUserDefaults - which stores a property list.
Outlet; Action
Points - to achieve device-independence
'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.
36. The setters for outlets are called by _______ at this point ______________.
Two CGFloats for x and y
My rectangle in my superview's coordinate space
constant NSString
iOS; when the view is loaded.
37. What do I use for a bag of bits?
(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.
NSData
Cocoa Touch - Media - Core Services - Core OS
NSUserDefaults - which stores a property list.
38. How to see all actions - outlets - incoming/outgoing segues on a view?
[Object isMemberOfClass:[Classname class]]
The document; possibly a database.
The compiler adds code to count references.
Right-click on view - or even a subview like a button.
39. ________ implements the getter and setter. But we can always__________
@synthesize; write our own getter and/or setter.
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
(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.
My rectangle in my superview's coordinate space
40. What does the controller do?
Controls how the model is presented onscreen.
Wrap it in NSValue. And remember that NSValue immutable.
create a model
Argument validation.
41. The controller is always a subclass of...?
UIViewController.
id
for...in; don't change things inside the loop.
MVC - for model-view-controller
42. How many superviews does a view have? How many subviews?
A rectangular area
One; zero to many
NSArray; no - it's immutable.
[Class respondsToSelector:@selector(aMethod)]
43. Class methods are used for ___________ and the call starts with ____________.
The runtime system asks the object what its class is.
Never!
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
NSLog; %@; %d and other formatters
44. How can I find out the class of any object? Give a line of code.
Right-click on view - or even a subview like a button.
Nothing happens - and nil is returned.
Dash - Plus sign.
Class XX = [Object class]
45. 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
46. What to do in Xcode for short documentation? For full documentation?
option-click; option-double-click
No - it gets the data from the controller.
The document; possibly a database.
A CGPoint and and a CGSize
47. How to tell whether an object implements a particular method? (A line of code)
'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.
A CGPoint and and a CGSize
NSObject
[Class respondsToSelector:@selector(aMethod)]
48. ______ is a pointer to any object.
Center of the frame - which is in the superview's coordinate system
MVC - for model-view-controller
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
49. List the iOS hierarchy from top to bottom.
Strong. Object memory is freed at the end of the routine.
Cocoa Touch - Media - Core Services - Core OS
One; zero to many
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.
50. A property is just the combination of _______.
NSData
Getter and setter methods.
NSObject
To zero; so pointers are nil.