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. In the initializer methods of objects I create - add what line of code? Why?
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.
To zero; so pointers are nil.
Cocoa Touch - Media - Core Services - Core OS
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
2. The decision on what method to call is made when?
Properties; instance variables
At runtime.
My rectangle in my superview's coordinate space
UIViewController.
3. ______ is a pointer
(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.
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
NSSet; no - it's immutable
self
4. 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
5. 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
6. In a nutshell: how to do custom drawing?
'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.'
Override drawRect:
No. Use NSMutableArray - which is a subclass of NSArray.
Argument validation.
7. What is a reason to write our own setter?
Argument validation.
'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.
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
Never!
8. What do I use for a bag of bits?
internal origin and size. Use this inside a view
self.view
addSubview; removeFromSubview
NSData
9. What does 'strong' mean?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
10. Instance methods start with a ______ and class methods start with a ______.
Dash - Plus sign.
self
Never!
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
11. 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
12. How can I save user information between launches of my app?
Can handle any language because it uses Unicode.
NSUserDefaults - which stores a property list.
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
Class XX = [Object class]
13. How is ARC done?
self
The compiler adds code to count references.
To zero; so pointers are 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.
14. Are local pointers to objects strong or weak? So what happens at the end of the routine?
The document; possibly a database.
Center of the frame - which is in the superview's coordinate system
NSObject
Strong. Object memory is freed at the end of the routine.
15. 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
16. How to tell whether an object implements a particular method? (A line of code)
line up the colons!
Lazy instantiation.
[Class respondsToSelector:@selector(aMethod)]
No. It's fine.
17. How many superviews does a view have? How many subviews?
One; zero to many
NSLog; %@; %d and other formatters
'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.
addSubview; removeFromSubview
18. Show a private interface section.
NSNumber. For example numberWithDouble: and doubleValue:
Interface; Implementation
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
One; zero to many
19. All properties are initialized to _____
The document; possibly a database.
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.
iOS; when the view is loaded.
zero/nil
20. List the iOS hierarchy from top to bottom.
A CGPoint and and a CGSize
Two floats - for width and height
Cocoa Touch - Media - Core Services - Core OS
Never!
21. Why are properties good?
UIWindow
(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.
A rectangular area
An outlet.
22. Talk about BOOL variables.
Center of the frame - which is in the superview's coordinate system
[Object isMemberOfClass:[Classname class]]
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.
23. A property is just the combination of _______.
constant NSString
'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.
Getter and setter methods.
Designated initializer.
24. Dot notation does what?
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
On left side - is calling the setter - and on the right side - is calling the getter.
Right-click on view - or even a subview like a button.
'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.'
25. The single-view template in Xcode does not...
create a model
id; an object pointer
No. Use NSMutableArray - which is a subclass of NSArray.
Lazy instantiation.
26. ________ implements the getter and setter. But we can always__________
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
NSArray; no - it's immutable.
@synthesize; write our own getter and/or setter.
NSData
27. The view is...
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
28. Class methods are used for ___________ and the call starts with ____________.
Strongly.
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
NSUserDefaults - which stores a property list.
[Class respondsToSelector:@selector(aMethod)]
29. 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
30. If I need to convert a number to an object - use __________
Two floats - for width and height
self.view
create a model
NSNumber. For example numberWithDouble: and doubleValue:
31. What is used in lieu of pixels? And why?
Points - to achieve device-independence
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
The compiler adds code to count references.
No. It's fine.
32. When is it OK to call drawRect: directly?
'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.
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
Never!
33. Where do I initialize properties?
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
Other MVC trios.
In the getter! This is called lazy instantiation.
NSDictionary; no - it's immutable.
34. Classes cannot have _________ or ___________.
the controller's minions. Gets things to the screen.
self.view
Properties; instance variables
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.
35. The controller is always a subclass of...?
@synthesize; write our own getter and/or setter.
UIViewController.
Override drawRect:
The compiler adds code to count references.
36. Objects in an array: are the pointed to strongly or weakly?
Can handle any language because it uses Unicode.
Import / handle multiple inclusion.
Strongly.
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
37. What about controller talking to the model?
Yes. The controller knows everything about the model.
NSSet; no - it's immutable
Wrap it in NSValue. And remember that NSValue immutable.
An outlet.
38. How are local variables initialized in iOS 5?
Never!
To zero; so pointers are nil.
NSData
Nothing happens - and nil is returned.
39. What is an example of a reason to write a getter?
NSData
Dash - Plus sign.
Lazy instantiation.
The runtime system asks the object what its class is.
40. 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
41. 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
42. There is no difference between _____ and _______ at runtime.
The compiler adds code to count references.
Interface; Implementation
self.view
id; an object pointer
43. What is the fundamental design pattern of iOS development?
In the getter! This is called lazy instantiation.
No. It's fine.
MVC - for model-view-controller
No...but it has 'a way' to notify the controller to come ask for fresh data.
44. 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
45. What does a view (UIView) represent?
NSNumber. For example numberWithDouble: and doubleValue:
A rectangular area
The document; possibly a database.
To zero; so pointers are nil.
46. ______ is a pointer to any object.
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
id
Two floats - for width and height
Introspection - with the class method 'class'
47. Instead of 'include' statements - in Objective-C we use _______ which does ________
Import / handle multiple inclusion.
Controls how the model is presented onscreen.
line up the colons!
'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.
48. How to tell whether an object is of a class or class that inherits from that class? (Write a line of code)
Argument validation.
self.view
@synthesize; write our own getter and/or setter.
[Object isKindOfClass:[Classname class]]
49. What is the makeup of a CGPoint?
In the getter! This is called lazy instantiation.
id; an object pointer
Two CGFloats for x and y
Points - to achieve device-independence
50. 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