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. If a method starts with a dash - it's a ___________. If it starts with a plus sign - it's a ______________.
Cocoa Touch - Media - Core Services - Core OS
A CGPoint and and a CGSize
No. It's fine.
Instance method; class method.
2. 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
3. What is an example of a reason to write a getter?
create a model
NSDictionary; no - it's immutable.
Lazy instantiation.
Getter and setter methods.
4. ________ is the .h file and __________ is the .m file.
Two floats - for width and height
Center of the frame - which is in the superview's coordinate system
Interface; Implementation
for...in; don't change things inside the loop.
5. The decision on what method to call is made when?
A rectangular area
NSLog; %@; %d and other formatters
At runtime.
internal origin and size. Use this inside a view
6. Talk about BOOL variables.
Two CGFloats for x and y
NO is zero; YES is anything else.
To zero; so pointers are nil.
create a model
7. Use ______ to send debugging messages to the console. Use _____ for any object - which should return an string. Can also use ______.
[[UIView alloc] initWithFrame]
NSLog; %@; %d and other formatters
NSNumber. For example numberWithDouble: and doubleValue:
iOS; when the view is loaded.
8. Instead of 'include' statements - in Objective-C we use _______ which does ________
Class XX = [Object class]
Cocoa Touch - Media - Core Services - Core OS
Import / handle multiple inclusion.
One; zero to many
9. 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.
Points - to achieve device-independence
The document; possibly a database.
option-click; option-double-click
10. Is NSArray mutable?
No. It's fine.
On left side - is calling the setter - and on the right side - is calling the getter.
No. Use NSMutableArray - which is a subclass of NSArray.
create a model
11. How to force a redraw of a custom area?
id
Outlet; Action
Call setNeedsDisplay:
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
12. Does a view 'own' the data it displays?
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
No - it gets the data from the controller.
internal origin and size. Use this inside a view
Import / handle multiple inclusion.
13. 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
14. How to tell whether an object is of a class or class that inherits from that class? (Write a line of code)
[Object isKindOfClass:[Classname class]]
Strongly.
Getter and setter methods.
NO is zero; YES is anything else.
15. How to access the controller's top view?
Dash - Plus sign.
NO is zero; YES is anything else.
Strongly.
self.view
16. The view is...
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
17. How to tell if an object is of a particular class? (Write a line of code)
[Object isMemberOfClass:[Classname class]]
NSDictionary; no - it's immutable.
Yes. The controller knows everything about the model.
Interface; Implementation
18. If I need to convert a number to an object - use __________
Never!
NSNumber. For example numberWithDouble: and doubleValue:
NSLog; %@; %d and other formatters
addSubview; removeFromSubview
19. What is the fundamental design pattern of iOS development?
Right-click on view - or even a subview like a button.
The compiler adds code to count references.
(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.
MVC - for model-view-controller
20. How many superviews does a view have? How many subviews?
One; zero to many
Right-click on view - or even a subview like a button.
self.view
Points - to achieve device-independence
21. List the iOS hierarchy from top to bottom.
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
Cocoa Touch - Media - Core Services - Core OS
The document; possibly a database.
An outlet.
22. Are local pointers to objects strong or weak? So what happens at the end of the routine?
Right-click on view - or even a subview like a button.
internal origin and size. Use this inside a view
Strong. Object memory is freed at the end of the routine.
Can handle any language because it uses Unicode.
23. What does 'strong' mean?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
24. How to see all actions - outlets - incoming/outgoing segues on a view?
Two floats - for width and height
Right-click on view - or even a subview like a button.
[Class respondsToSelector:@selector(aMethod)]
NSLog; %@; %d and other formatters
25. How are local variables initialized in iOS 5?
Two floats - for width and height
In the getter! This is called lazy instantiation.
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.
26. What is a reason to write our own setter?
No. It's fine.
The compiler adds code to count references.
Other MVC trios.
Argument validation.
27. What is in the model?
The document; possibly a database.
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
Other MVC trios.
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
28. Objects in an array: are the pointed to strongly or weakly?
Controls how the model is presented onscreen.
Strongly.
Override drawRect:
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
29. What if I want to put a scalar into an NSArray or NSSet?
for...in; don't change things inside the loop.
Action
No...but it has 'a way' to notify the controller to come ask for fresh data.
Wrap it in NSValue. And remember that NSValue immutable.
30. All properties are initialized to _____
zero/nil
[Object isMemberOfClass:[Classname class]]
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
Don't use id for a pointer. Use the actual type pointed to. It allows the compiler (but not the runtime!) to help find bugs.
31. Dot notation does what?
Cocoa Touch - Media - Core Services - Core OS
On left side - is calling the setter - and on the right side - is calling the getter.
create a model
Class XX = [Object class]
32. Classes cannot have _________ or ___________.
NSSet; no - it's immutable
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
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.
33. How to create a UIView in code?
No. It's fine.
[[UIView alloc] initWithFrame]
for...in; don't change things inside the loop.
On left side - is calling the setter - and on the right side - is calling the getter.
34. A _______ is how a view notifies the controller of something - for example - a button press.
create a model
Action
Dash - Plus sign.
Designated initializer.
35. 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
36. What is the name of a property in the controller that it uses to talk to views?
Points - to achieve device-independence
An outlet.
Wrap it in NSValue. And remember that NSValue immutable.
Nothing happens - and nil is returned.
37. 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
38. What does a view (UIView) represent?
[Object isKindOfClass:[Classname class]]
zero/nil
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
A rectangular area
39. The controller is always a subclass of...?
addSubview; removeFromSubview
An outlet.
UIViewController.
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.
40. What about controller talking to the model?
'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 framework.
Yes. The controller knows everything about the model.
No. It's fine.
41. ______ is a pointer to any object.
Yes. The controller knows everything about the model.
Designated initializer.
id
Class XX = [Object class]
42. Instance methods start with a ______ and class methods start with a ______.
Controls how the model is presented onscreen.
Dash - Plus sign.
UIViewController.
Outlet; Action
43. A property is just the combination of _______.
Getter and setter methods.
Designated initializer.
NSLog; %@; %d and other formatters
A framework.
44. There is no difference between _____ and _______ at runtime.
id; an object pointer
The document; possibly a database.
The compiler adds code to count references.
NSDictionary; no - it's immutable.
45. What to do in Xcode for short documentation? For full documentation?
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
Introspection - with the class method 'class'
No - it gets the data from the controller.
46. What is the makeup of a CGPoint?
create a model
[Class respondsToSelector:@selector(aMethod)]
Two CGFloats for x and y
Wrap it in NSValue. And remember that NSValue immutable.
47. The setters for outlets are called by _______ at this point ______________.
Interface; Implementation
A CGPoint and and a CGSize
iOS; when the view is loaded.
Don't use id for a pointer. Use the actual type pointed to. It allows the compiler (but not the runtime!) to help find bugs.
48. What is the bounds property of a UIView?
internal origin and size. Use this inside a view
Two CGFloats for x and y
Dash - Plus sign.
Two floats - for width and height
49. 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.
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
Interface; Implementation
self
50. What is the base class for most objects in the iOS SDK?
No. Use NSMutableArray - which is a subclass of NSArray.
Cocoa Touch - Media - Core Services - Core OS
NSObject
The runtime system asks the object what its class is.