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. How can I save user information between launches of my app?
line up the colons!
constant NSString
[Class respondsToSelector:@selector(aMethod)]
NSUserDefaults - which stores a property list.
2. All properties are initialized to _____
zero/nil
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.
A rectangular area
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
3. 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
4. What is used in lieu of pixels? And why?
Two CGFloats for x and y
for...in; don't change things inside the loop.
the controller's minions. Gets things to the screen.
Points - to achieve device-independence
5. How to instantiate an object?
NSArray; no - it's immutable.
@synthesize; write our own getter and/or setter.
A framework.
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
6. How to tell whether an object implements a particular method? (A line of code)
A framework.
Instance variable (ivar) or 'backing variable'
An outlet.
[Class respondsToSelector:@selector(aMethod)]
7. List the iOS hierarchy from top to bottom.
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
Cocoa Touch - Media - Core Services - Core OS
UIViewController.
A CGPoint and and a CGSize
8. Dot notation does what?
Points - to achieve device-independence
Instance method; class method.
Right-click on view - or even a subview like a button.
On left side - is calling the setter - and on the right side - is calling the getter.
9. How to create a UIView in code?
At runtime.
[[UIView alloc] initWithFrame]
Never!
id
10. When happens when you send a message to nil?
Nothing happens - and nil is returned.
@synthesize; write our own getter and/or setter.
[Object isKindOfClass:[Classname class]]
Designated initializer.
11. How to see all actions - outlets - incoming/outgoing segues on a view?
Right-click on view - or even a subview like a button.
[Object isKindOfClass:[Classname class]]
[[UIView alloc] initWithFrame]
Import / handle multiple inclusion.
12. Can the controller talking to the view?
In the getter! This is called lazy instantiation.
Never!
Yes. As much as it wants.
Two CGFloats for x and y
13. What is the makeup of a CGPoint?
self.view
Override drawRect:
Two CGFloats for x and y
Yes. As much as it wants.
14. ________ implements the getter and setter. But we can always__________
The compiler adds code to count references.
Strongly.
@synthesize; write our own getter and/or setter.
Two floats - for width and height
15. What is a property list?
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
NSSet; no - it's immutable
On left side - is calling the setter - and on the right side - is calling the getter.
Call setNeedsDisplay:
16. 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
17. The decision on what method to call is made when?
Never!
At runtime.
Cocoa Touch - Media - Core Services - Core OS
Controls how the model is presented onscreen.
18. When is it OK to call drawRect: directly?
Yes. The controller knows everything about the model.
Never!
Points - to achieve device-independence
MVC - for model-view-controller
19. How to add subviews in code? How to remove them?
Interface; Implementation
addSubview; removeFromSubview
NSLog; %@; %d and other formatters
id; an object pointer
20. What do I use for a bag of bits?
Wrap it in NSValue. And remember that NSValue immutable.
NSData
id
for...in; don't change things inside the loop.
21. Instead of 'include' statements - in Objective-C we use _______ which does ________
No...but it has 'a way' to notify the controller to come ask for fresh data.
NO is zero; YES is anything else.
UIViewController.
Import / handle multiple inclusion.
22. How to access the controller's top view?
Introspection - with the class method 'class'
Never!
self.view
[[UIView alloc] initWithFrame]
23. How many superviews does a view have? How many subviews?
NSData
On left side - is calling the setter - and on the right side - is calling the getter.
One; zero to many
Yes. As much as it wants.
24. ______ is a pointer
NSObject
Instance variable (ivar) or 'backing variable'
self
To zero; so pointers are nil.
25. What does 'weak' mean?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
26. 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.
Class XX = [Object class]
No - it gets the data from the controller.
'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.'
27. 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.
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
To zero; so pointers are nil.
[Object isMemberOfClass:[Classname class]]
28. What is the base class for most objects in the iOS SDK?
id
NSDictionary; no - it's immutable.
NSObject
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
29. What is the name of a property in the controller that it uses to talk to views?
NSDictionary; no - it's immutable.
self.view
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.
An outlet.
30. ________ is the .h file and __________ is the .m file.
Interface; Implementation
No. It's fine.
Never!
On left side - is calling the setter - and on the right side - is calling the getter.
31. How is ARC done?
The compiler adds code to count references.
Properties; instance variables
Strong. Object memory is freed at the end of the routine.
Import / handle multiple inclusion.
32. 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
33. What about the model and the view talking to one another?
Never!
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.
UIViewController.
Can handle any language because it uses Unicode.
34. How are local variables initialized in iOS 5?
To zero; so pointers are nil.
Class XX = [Object class]
Right-click on view - or even a subview like a button.
line up the colons!
35. 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
36. 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
37. If a method starts with a dash - it's a ___________. If it starts with a plus sign - it's a ______________.
Sort of - in ways that it doesn't need to know much about the controller. For example: delegation.
Instance method; class method.
Yes. The controller knows everything about the model.
Strong. Object memory is freed at the end of the routine.
38. A _______ is how a view notifies the controller of something - for example - a button press.
Action
A rectangular area
'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.
Two floats - for width and height
39. What is the bounds property of a UIView?
Nothing happens - and nil is returned.
internal origin and size. Use this inside a view
Yes. The controller knows everything about the model.
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
40. Are local pointers to objects strong or weak? So what happens at the end of the routine?
Other MVC trios.
Nothing happens - and nil is returned.
Yes. The controller knows everything about the model.
Strong. Object memory is freed at the end of the routine.
41. Talk about NSString
Right-click on view - or even a subview like a button.
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
Can handle any language because it uses Unicode.
Properties; instance variables
42. Talk about BOOL variables.
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
NO is zero; YES is anything else.
NSUserDefaults - which stores a property list.
At runtime.
43. The setters for outlets are called by _______ at this point ______________.
iOS; when the view is loaded.
Interface; Implementation
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
44. Some controllers have ____________ as their views.
No. It's fine.
Other MVC trios.
Strongly.
Sort of - in ways that it doesn't need to know much about the controller. For example: delegation.
45. Objects in an array: are the pointed to strongly or weakly?
Cocoa Touch - Media - Core Services - Core OS
Strongly.
Properties; instance variables
Override drawRect:
46. A property is just the combination of _______.
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
A framework.
Getter and setter methods.
NSNumber. For example numberWithDouble: and doubleValue:
47. What to do in Xcode for short documentation? For full documentation?
constant NSString
option-click; option-double-click
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
A framework.
48. You can send a message to a...
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
Instance method; class method.
To zero; so pointers are nil.
constant NSString
49. Classes cannot have _________ or ___________.
Properties; instance variables
The document; possibly a database.
Getter and setter methods.
line up the colons!
50. All classes should have a __________________ to be called by subclasses.
Getter and setter methods.
A CGPoint and and a CGSize
In the getter! This is called lazy instantiation.
Designated initializer.