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 makeup of a CGPoint?
for...in; don't change things inside the loop.
Two CGFloats for x and y
NSLog; %@; %d and other formatters
'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.'
2. Talk about BOOL variables.
NO is zero; YES is anything else.
Dash - Plus sign.
id
A rectangular area
3. How to create a UIView in code?
[[UIView alloc] initWithFrame]
NSNumber. For example numberWithDouble: and doubleValue:
self
Yes. As much as it wants.
4. Is NSArray mutable?
No. Use NSMutableArray - which is a subclass of NSArray.
In the getter! This is called lazy instantiation.
internal origin and size. Use this inside a view
Override drawRect:
5. The view is...
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
6. How to tell whether an object is of a class or class that inherits from that class? (Write a line of code)
The document; possibly a database.
NO is zero; YES is anything else.
NSNumber. For example numberWithDouble: and doubleValue:
[Object isKindOfClass:[Classname class]]
7. What is the makeup of a CGSize?
for...in; don't change things inside the loop.
[Object isKindOfClass:[Classname class]]
Two floats - for width and height
iOS; when the view is loaded.
8. What is in the model?
Yes. The controller knows everything about the model.
NSNumber. For example numberWithDouble: and doubleValue:
Strongly.
The document; possibly a database.
9. In the initializer methods of objects I create - add what line of code? Why?
An outlet.
Call setNeedsDisplay:
Argument validation.
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.
10. What about the model and the view talking to one another?
NSArray; no - it's immutable.
Never!
option-click; option-double-click
NSNumber. For example numberWithDouble: and doubleValue:
11. Class methods are used for ___________ and the call starts with ____________.
No...but it has 'a way' to notify the controller to come ask for fresh data.
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.
Action
12. If a method starts with a dash - it's a ___________. If it starts with a plus sign - it's a ______________.
Yes. The controller knows everything about the model.
Never!
Instance method; class method.
NSNumber. For example numberWithDouble: and doubleValue:
13. What about controller talking to the model?
Center of the frame - which is in the superview's coordinate system
The document; possibly a database.
Yes. The controller knows everything about the model.
Dash - Plus sign.
14. A _______ goes from the Controller to the View. A ________ goes from the view to the controller.
Introspection - with the class method 'class'
NSSet; no - it's immutable
Can handle any language because it uses Unicode.
Outlet; Action
15. 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.
Interface; Implementation
Never!
line up the colons!
16. What is the fundamental design pattern of iOS development?
NSDictionary; no - it's immutable.
Call setNeedsDisplay:
Override drawRect:
MVC - for model-view-controller
17. What is used in lieu of pixels? And why?
NSSet; no - it's immutable
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.
Call setNeedsDisplay:
18. What does 'weak' mean?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
19. Why are properties good?
A CGPoint and and a CGSize
Two floats - for width and height
(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.
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
20. 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
21. All classes should have a __________________ to be called by subclasses.
Designated initializer.
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
At runtime.
[[UIView alloc] initWithFrame]
22. How can I find out the class of any object? Give a line of code.
Class XX = [Object class]
Never!
Dash - Plus sign.
zero/nil
23. 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
24. The setters for outlets are called by _______ at this point ______________.
NSSet; no - it's immutable
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
iOS; when the view is loaded.
Cocoa Touch - Media - Core Services - Core OS
25. ______ is a pointer to any object.
id
[[UIView alloc] initWithFrame]
Designated initializer.
line up the colons!
26. If I need to convert a number to an object - use __________
Never!
NSNumber. For example numberWithDouble: and doubleValue:
Other MVC trios.
No...but it has 'a way' to notify the controller to come ask for fresh data.
27. Are local pointers to objects strong or weak? So what happens at the end of the routine?
Two floats - for width and height
Getter and setter methods.
NSArray; no - it's immutable.
Strong. Object memory is freed at the end of the routine.
28. All properties are initialized to _____
zero/nil
Cocoa Touch - Media - Core Services - Core OS
[Object isMemberOfClass:[Classname class]]
'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.
29. 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];
Two floats - for width and height
addSubview; removeFromSubview
Can handle any language because it uses Unicode.
30. The decision on what method to call is made when?
Properties; instance variables
Never!
At runtime.
Instance method; class method.
31. A property is just the combination of _______.
Override drawRect:
The runtime system asks the object what its class is.
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
Getter and setter methods.
32. 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
33. Show a private interface section.
Dash - Plus sign.
Call setNeedsDisplay:
NSUserDefaults - which stores a property list.
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
34. How to access the controller's top view?
Controls how the model is presented onscreen.
Argument validation.
NSLog; %@; %d and other formatters
self.view
35. Where do I initialize properties?
NSDictionary; no - it's immutable.
Yes. As much as it wants.
In the getter! This is called lazy instantiation.
No...but it has 'a way' to notify the controller to come ask for fresh data.
36. What is the bounds property of a UIView?
No - it gets the data from the controller.
internal origin and size. Use this inside a view
Argument validation.
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
37. 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
38. How many superviews does a view have? How many subviews?
MVC - for model-view-controller
NSArray; no - it's immutable.
UIWindow
One; zero to many
39. What is a property list?
Can handle any language because it uses Unicode.
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
self
Dash - Plus sign.
40. 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
41. 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
42. What does a view (UIView) represent?
NSObject
Interface; Implementation
A rectangular area
Class XX = [Object class]
43. 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
44. What to do in Xcode for short documentation? For full documentation?
Never!
A rectangular area
self
option-click; option-double-click
45. ______ is a pointer
Can handle any language because it uses Unicode.
Class XX = [Object class]
self.view
self
46. What is the makeup of a CGRect?
A CGPoint and and a CGSize
self
The document; possibly a database.
self.view
47. The single-view template in Xcode does not...
Yes. The controller knows everything about the model.
Action
Lazy instantiation.
create a model
48. How to tell if an object is of a particular class? (Write a line of code)
[Object isKindOfClass:[Classname class]]
UIViewController.
[Object isMemberOfClass:[Classname class]]
One; zero to many
49. 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
50. What does 'strong' mean?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183