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