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. Where do I initialize properties?
NSNumber. For example numberWithDouble: and doubleValue:
In the getter! This is called lazy instantiation.
internal origin and size. Use this inside a view
NSObject
2. 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
3. How to add subviews in code? How to remove them?
Call setNeedsDisplay:
Never!
Override drawRect:
addSubview; removeFromSubview
4. What is the base class for most objects in the iOS SDK?
A CGPoint and and a CGSize
Other MVC trios.
NSObject
Lazy instantiation.
5. The setters for outlets are called by _______ at this point ______________.
Lazy instantiation.
Yes. As much as it wants.
constant NSString
iOS; when the view is loaded.
6. Show a private interface section.
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
Points - to achieve device-independence
constant NSString
The document; possibly a database.
7. Dot notation does what?
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
Designated initializer.
addSubview; removeFromSubview
On left side - is calling the setter - and on the right side - is calling the getter.
8. 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
9. What does 'weak' mean?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
10. Is NSArray mutable?
No. Use NSMutableArray - which is a subclass of NSArray.
Lazy instantiation.
Wrap it in NSValue. And remember that NSValue immutable.
Import / handle multiple inclusion.
11. What to do in Xcode for short documentation? For full documentation?
Cocoa Touch - Media - Core Services - Core OS
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
option-click; option-double-click
Yes. The controller knows everything about the model.
12. ________ implements the getter and setter. But we can always__________
Two floats - for width and height
@synthesize; write our own getter and/or setter.
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
zero/nil
13. 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
14. ________ is the .h file and __________ is the .m file.
Lazy instantiation.
NSSet; no - it's immutable
Nothing happens - and nil is returned.
Interface; Implementation
15. 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.
zero/nil
[[UIView alloc] initWithFrame]
No...but it has 'a way' to notify the controller to come ask for fresh data.
16. Instead of 'include' statements - in Objective-C we use _______ which does ________
Import / handle multiple inclusion.
Instance method; class method.
Can handle any language because it uses Unicode.
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
17. ______ is a pointer to any object.
No...but it has 'a way' to notify the controller to come ask for fresh data.
id
NSNumber. For example numberWithDouble: and doubleValue:
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
18. When is it OK to call drawRect: directly?
Never!
@synthesize; write our own getter and/or setter.
NO is zero; YES is anything else.
Other MVC trios.
19. When happens when you send a message to nil?
Wrap it in NSValue. And remember that NSValue immutable.
Nothing happens - and nil is returned.
Properties; instance variables
MVC - for model-view-controller
20. 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
21. Talk about BOOL variables.
self.view
Strong. Object memory is freed at the end of the routine.
The document; possibly a database.
NO is zero; YES is anything else.
22. 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];
Never!
[[UIView alloc] initWithFrame]
MVC - for model-view-controller
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. Remember that it's cool to...
Sort of - in ways that it doesn't need to know much about the controller. For example: delegation.
NSUserDefaults - which stores a property list.
Strong. Object memory is freed at the end of the routine.
line up the colons!
25. How is ARC done?
Outlet; Action
One; zero to many
The compiler adds code to count references.
self.view
26. Calling a method on id works just fine because....?
'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.'
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
Interface; Implementation
The runtime system asks the object what its class is.
27. A _______ is how a view notifies the controller of something - for example - a button press.
option-click; option-double-click
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
Action
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. What is in the model?
NSSet; no - it's immutable
The document; possibly a database.
for...in; don't change things inside the loop.
NSDictionary; no - it's immutable.
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. Class methods are used for ___________ and the call starts with ____________.
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
Designated initializer.
'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.
NSSet; no - it's immutable
31. What about controller talking to the model?
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
[Object isKindOfClass:[Classname class]]
self
Yes. The controller knows everything about the model.
32. 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
33. 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
34. What is the word for checking/verifying the type of an object?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
35. How to access the controller's top view?
UIViewController.
No - it gets the data from the controller.
self.view
Getter and setter methods.
36. If a method starts with a dash - it's a ___________. If it starts with a plus sign - it's a ______________.
Two CGFloats for x and y
Instance method; class method.
the controller's minions. Gets things to the screen.
[Object isMemberOfClass:[Classname class]]
37. What is the makeup of a CGRect?
A CGPoint and and a CGSize
create a model
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
zero/nil
38. Use ______ to send debugging messages to the console. Use _____ for any object - which should return an string. Can also use ______.
No. Use NSMutableArray - which is a subclass of NSArray.
NSLog; %@; %d and other formatters
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
Never!
39. How are local variables initialized in iOS 5?
NO is zero; YES is anything else.
A framework.
Two CGFloats for x and y
To zero; so pointers are nil.
40. 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
41. List the iOS hierarchy from top to bottom.
Properties; instance variables
Cocoa Touch - Media - Core Services - Core OS
id
A rectangular area
42. How can I save user information between launches of my app?
At runtime.
NSUserDefaults - which stores a property list.
A rectangular area
(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.
43. The basic steps in custom drawing.
Points - to achieve device-independence
Two floats - for width and height
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
Controls how the model is presented onscreen.
44. How many superviews does a view have? How many subviews?
Designated initializer.
One; zero to many
Controls how the model is presented onscreen.
At runtime.
45. In a nutshell: how to do custom drawing?
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.
Nothing happens - and nil is returned.
Override drawRect:
Never!
46. If I need to convert a number to an object - use __________
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
Override drawRect:
NSNumber. For example numberWithDouble: and doubleValue:
A CGPoint and and a CGSize
47. Talk about NSString
A CGPoint and and a CGSize
Can handle any language because it uses Unicode.
NSUserDefaults - which stores a property list.
One; zero to many
48. What is at the top of the view hierarchy?
UIWindow
NO is zero; YES is anything else.
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
Outlet; Action
49. 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
50. What is a reason to write our own setter?
Argument validation.
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
for...in; don't change things inside the loop.
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.