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 a reason to write our own setter?
Two CGFloats for x and y
Two floats - for width and height
Strongly.
Argument validation.
2. What is a property list?
In the getter! This is called lazy instantiation.
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
Nothing happens - and nil is returned.
Points - to achieve device-independence
3. 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
4. How to access the controller's top 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.
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
self.view
No. Use NSMutableArray - which is a subclass of NSArray.
5. A _______ is how a view notifies the controller of something - for example - a button press.
UIWindow
Points - to achieve device-independence
constant NSString
Action
6. What is the iOS term for a library?
Never!
'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.
A framework.
A CGPoint and and a CGSize
7. 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
8. Instead of 'include' statements - in Objective-C we use _______ which does ________
Override drawRect:
Properties; instance variables
Import / handle multiple inclusion.
Other MVC trios.
9. 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
10. Use ______ to send debugging messages to the console. Use _____ for any object - which should return an string. Can also use ______.
Class XX = [Object class]
NSLog; %@; %d and other formatters
Instance variable (ivar) or 'backing variable'
Dash - Plus sign.
11. What about controller talking to the model?
A framework.
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
'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.'
Yes. The controller knows everything about the model.
12. When happens when you send a message to nil?
for...in; don't change things inside the loop.
Nothing happens - and nil is returned.
Two CGFloats for x and y
Strongly.
13. What is the fundamental design pattern of iOS development?
No...but it has 'a way' to notify the controller to come ask for fresh data.
internal origin and size. Use this inside a view
MVC - for model-view-controller
A framework.
14. 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
15. Calling a method on id works just fine because....?
Properties; instance variables
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
The runtime system asks the object what its class is.
NSSet; no - it's immutable
16. The controller is always a subclass of...?
Controls how the model is presented onscreen.
UIViewController.
No. It's fine.
Right-click on view - or even a subview like a button.
17. If I need to convert a number to an object - use __________
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.
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.
NSNumber. For example numberWithDouble: and doubleValue:
[Object isMemberOfClass:[Classname class]]
18. A _______ goes from the Controller to the View. A ________ goes from the view to the controller.
Never!
Getter and setter methods.
Outlet; Action
My rectangle in my superview's coordinate space
19. Show a private interface section.
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
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.
To zero; so pointers are nil.
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
20. How can I find out the class of any object? Give a line of code.
Class XX = [Object class]
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
The compiler adds code to count references.
Introspection - with the class method 'class'
21. How many superviews does a view have? How many subviews?
Points - to achieve device-independence
NSNumber. For example numberWithDouble: and doubleValue:
line up the colons!
One; zero to many
22. Is NSString mutable or not?
Strong. Object memory is freed at the end of the routine.
Two CGFloats for x and y
MVC - for model-view-controller
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
23. ______ is a pointer to any object.
Points - to achieve device-independence
Instance method; class method.
id
Two CGFloats for x and y
24. What about the model and the view talking to one another?
Yes. As much as it wants.
Never!
Override drawRect:
the controller's minions. Gets things to the screen.
25. When is it OK to call drawRect: directly?
Never!
id
iOS; when the view is loaded.
self
26. Objects in an array: are the pointed to strongly or weakly?
Strongly.
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
Override drawRect:
The document; possibly a database.
27. List the iOS hierarchy from top to bottom.
NO is zero; YES is anything else.
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.
Argument validation.
Cocoa Touch - Media - Core Services - Core OS
28. 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
29. The setters for outlets are called by _______ at this point ______________.
[Class respondsToSelector:@selector(aMethod)]
iOS; when the view is loaded.
At runtime.
Properties; instance variables
30. ________ is the .h file and __________ is the .m file.
Two floats - for width and height
Interface; Implementation
A framework.
NSDictionary; no - it's immutable.
31. A property is just the combination of _______.
Getter and setter methods.
NSLog; %@; %d and other formatters
Strong. Object memory is freed at the end of the routine.
No. Use NSMutableArray - which is a subclass of NSArray.
32. How to instantiate an object?
The document; possibly a database.
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
NSNumber. For example numberWithDouble: and doubleValue:
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 add subviews in code? How to remove them?
Right-click on view - or even a subview like a button.
[Object isMemberOfClass:[Classname class]]
constant NSString
addSubview; removeFromSubview
34. What is used in lieu of pixels? And why?
Points - to achieve device-independence
Import / handle multiple inclusion.
Instance method; class method.
UIWindow
35. The decision on what method to call is made when?
At runtime.
Can handle any language because it uses Unicode.
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
self.view
36. ______ is a pointer
Sort of - in ways that it doesn't need to know much about the controller. For example: delegation.
A framework.
UIViewController.
self
37. What is in the model?
A framework.
id
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
The document; possibly a database.
38. Are local pointers to objects strong or weak? So what happens at the end of the routine?
UIWindow
On left side - is calling the setter - and on the right side - is calling the getter.
Strong. Object memory is freed at the end of the routine.
NO is zero; YES is anything else.
39. Dot notation does what?
A rectangular area
iOS; when the view is loaded.
On left side - is calling the setter - and on the right side - is calling the getter.
Instance method; class method.
40. What is at the top of the view hierarchy?
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
'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.
UIWindow
internal origin and size. Use this inside a view
41. How are local variables initialized in iOS 5?
To zero; so pointers are nil.
Center of the frame - which is in the superview's coordinate system
One; zero to many
create a model
42. All properties are initialized to _____
The runtime system asks the object what its class is.
[Object isMemberOfClass:[Classname class]]
UIViewController.
zero/nil
43. 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
44. How to tell if an object is of a particular class? (Write a line of code)
My rectangle in my superview's coordinate space
[Object isMemberOfClass:[Classname class]]
NSLog; %@; %d and other formatters
Instance variable (ivar) or 'backing variable'
45. In the initializer methods of objects I create - add what line of code? Why?
'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.
constant NSString
Properties; instance variables
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.
46. What is the makeup of a CGSize?
Dash - Plus sign.
create a model
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.
Two floats - for width and height
47. In a nutshell: how to do custom drawing?
Override drawRect:
NSLog; %@; %d and other formatters
Can handle any language because it uses Unicode.
Controls how the model is presented onscreen.
48. What is the makeup of a CGPoint?
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
NSLog; %@; %d and other formatters
A CGPoint and and a CGSize
Two CGFloats for x and y
49. 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
50. What is the name of a property in the controller that it uses to talk to views?
Designated initializer.
UIViewController.
The compiler adds code to count references.
An outlet.