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 CGSize?
Two floats - for width and height
addSubview; removeFromSubview
MVC - for model-view-controller
A CGPoint and and a CGSize
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. 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
4. How is ARC done?
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
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.
The compiler adds code to count references.
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
5. How to create a UIView in code?
The compiler adds code to count references.
[[UIView alloc] initWithFrame]
No. Use NSMutableArray - which is a subclass of NSArray.
NSNumber. For example numberWithDouble: and doubleValue:
6. What is the fundamental design pattern of iOS development?
[Object isMemberOfClass:[Classname class]]
MVC - for model-view-controller
An outlet.
(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.
7. When happens when you send a message to nil?
'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.'
Nothing happens - and nil is returned.
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.
8. How to instantiate an object?
In the getter! This is called lazy instantiation.
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
the controller's minions. Gets things to the screen.
My rectangle in my superview's coordinate space
9. 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
10. How to tell whether an object implements a particular method? (A line of code)
My rectangle in my superview's coordinate space
No. It's fine.
internal origin and size. Use this inside a view
[Class respondsToSelector:@selector(aMethod)]
11. A _______ is how a view notifies the controller of something - for example - a button press.
Action
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
Instance method; class method.
Sort of - in ways that it doesn't need to know much about the controller. For example: delegation.
12. The controller is always a subclass of...?
UIViewController.
create a model
UIWindow
Never!
13. What is the name of a property in the controller that it uses to talk to views?
MVC - for model-view-controller
Strongly.
Other MVC trios.
An outlet.
14. How to add subviews in code? How to remove them?
option-click; option-double-click
On left side - is calling the setter - and on the right side - is calling the getter.
In the getter! This is called lazy instantiation.
addSubview; removeFromSubview
15. 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
16. Remember that it's cool to...
line up the colons!
UIViewController.
My rectangle in my superview's coordinate space
Points - to achieve device-independence
17. Show a private interface section.
Properties; instance variables
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
Controls how the model is presented onscreen.
18. What is the base class for most objects in the iOS SDK?
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
Action
NSNumber. For example numberWithDouble: and doubleValue:
NSObject
19. The basic steps in custom drawing.
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
Action
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
self
20. Class methods are used for ___________ and the call starts with ____________.
Dash - Plus sign.
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
for...in; don't change things inside the loop.
A CGPoint and and a CGSize
21. In the initializer methods of objects I create - add what line of code? Why?
(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.
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.
zero/nil
A rectangular area
22. What is the makeup of a CGRect?
A CGPoint and and a CGSize
option-click; option-double-click
MVC - for model-view-controller
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
23. ______ is a pointer to any object.
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
Lazy instantiation.
No. It's fine.
id
24. Some controllers have ____________ as their views.
NSNumber. For example numberWithDouble: and doubleValue:
Import / handle multiple inclusion.
Action
Other MVC trios.
25. How many superviews does a view have? How many subviews?
internal origin and size. Use this inside a view
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.
One; zero to many
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
26. What does 'weak' mean?
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
27. ________ implements the getter and setter. But we can always__________
No...but it has 'a way' to notify the controller to come ask for fresh data.
Never!
One; zero to many
@synthesize; write our own getter and/or setter.
28. When is it OK to call drawRect: directly?
Designated initializer.
Never!
internal origin and size. Use this inside a view
UIViewController.
29. Can the controller talking to the view?
Yes. As much as it wants.
My rectangle in my superview's coordinate space
The runtime system asks the object what its class is.
Cocoa Touch - Media - Core Services - Core OS
30. Talk about BOOL variables.
NO is zero; YES is anything else.
self.view
No - it gets the data from the controller.
internal origin and size. Use this inside a view
31. What is the makeup of a CGPoint?
In the getter! This is called lazy instantiation.
Two CGFloats for x and y
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
NSArray; no - it's immutable.
32. How are local variables initialized in iOS 5?
for...in; don't change things inside the loop.
To zero; so pointers are nil.
iOS; when the view is loaded.
Two floats - for width and height
33. 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
34. 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
35. The single-view template in Xcode does not...
Introspection - with the class method 'class'
create a model
On left side - is calling the setter - and on the right side - is calling the getter.
id
36. What is the bounds property of a UIView?
Properties; instance variables
Getter and setter methods.
Two CGFloats for x and y
internal origin and size. Use this inside a view
37. What if I want to put a scalar into an NSArray or NSSet?
Wrap it in NSValue. And remember that NSValue immutable.
line up the colons!
MVC - for model-view-controller
The document; possibly a database.
38. Dot notation does what?
NSSet; no - it's immutable
On left side - is calling the setter - and on the right side - is calling the getter.
Instance method; class method.
constant NSString
39. Does a view 'own' the data it displays?
Override drawRect:
A rectangular area
No - it gets the data from the controller.
[Object isMemberOfClass:[Classname class]]
40. Talk about NSString
Call setNeedsDisplay:
On left side - is calling the setter - and on the right side - is calling the getter.
Can handle any language because it uses Unicode.
Getter and setter methods.
41. How can I save user information between launches of my app?
NSUserDefaults - which stores a property list.
for...in; don't change things inside the loop.
NSLog; %@; %d and other formatters
zero/nil
42. How to tell whether an object is of a class or class that inherits from that class? (Write a line of code)
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
NSArray; no - it's immutable.
[Object isKindOfClass:[Classname class]]
[Class respondsToSelector:@selector(aMethod)]
43. Is NSArray mutable?
The runtime system asks the object what its class is.
No. Use NSMutableArray - which is a subclass of NSArray.
Right-click on view - or even a subview like a button.
Argument validation.
44. ________ is the .h file and __________ is the .m file.
NO is zero; YES is anything else.
Call setNeedsDisplay:
Wrap it in NSValue. And remember that NSValue immutable.
Interface; Implementation
45. Objects in an array: are the pointed to strongly or weakly?
At runtime.
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.
self.view
Strongly.
46. How can I find out the class of any object? Give a line of code.
Points - to achieve device-independence
for...in; don't change things inside the loop.
Designated initializer.
Class XX = [Object class]
47. 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
48. ______ is a pointer
No - it gets the data from the controller.
Points - to achieve device-independence
self
NSDictionary; no - it's immutable.
49. 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
50. Why are properties good?
Outlet; Action
(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.
create a model
Sort of - in ways that it doesn't need to know much about the controller. For example: delegation.