SUBJECTS
|
BROWSE
|
CAREER CENTER
|
POPULAR
|
JOIN
|
LOGIN
Business Skills
|
Soft Skills
|
Basic Literacy
|
Certifications
About
|
Help
|
Privacy
|
Terms
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. Is it always bad to send messages to id?
2. How to tell if an object is of a particular class? (Write a line of code)
Instance method; class method.
[Object isMemberOfClass:[Classname class]]
The compiler adds code to count references.
for...in; don't change things inside the loop.
3. What is the iOS term for a library?
A framework.
Dash - Plus sign.
NSData
NSLog; %@; %d and other formatters
4. Is NSArray mutable?
Yes. As much as it wants.
NSObject
No. Use NSMutableArray - which is a subclass of NSArray.
To zero; so pointers are nil.
5. In a nutshell: how to do custom drawing?
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
Designated initializer.
[Class respondsToSelector:@selector(aMethod)]
Override drawRect:
6. 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]]
Points - to achieve device-independence
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.
zero/nil
7. What is the makeup of a CGSize?
Cocoa Touch - Media - Core Services - Core OS
No...but it has 'a way' to notify the controller to come ask for fresh data.
Two floats - for width and height
Interface; Implementation
8. ______ is a pointer to any object.
My rectangle in my superview's coordinate space
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
id
Yes. As much as it wants.
9. What does 'weak' mean?
10. What about controller talking to the model?
Yes. The controller knows everything about the model.
Import / handle multiple inclusion.
No...but it has 'a way' to notify the controller to come ask for fresh data.
Two floats - for width and height
11. All properties are initialized to _____
NSLog; %@; %d and other formatters
zero/nil
A framework.
Instance variable (ivar) or 'backing variable'
12. How can I find out the class of any object? Give a line of code.
An outlet.
Argument validation.
My rectangle in my superview's coordinate space
Class XX = [Object class]
13. Can the controller talking to the view?
@synthesize; write our own getter and/or setter.
self
A CGPoint and and a CGSize
Yes. As much as it wants.
14. The basic steps in custom drawing.
Yes. The controller knows everything about the model.
Instance variable (ivar) or 'backing variable'
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
Getter and setter methods.
15. Show a private interface section.
Instance variable (ivar) or 'backing variable'
Strongly.
Class XX = [Object class]
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
16. What does 'strong' mean?
17. The single-view template in Xcode does not...
@synthesize; write our own getter and/or setter.
Strongly.
self.view
create a model
18. If a method starts with a dash - it's a ___________. If it starts with a plus sign - it's a ______________.
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.
No...but it has 'a way' to notify the controller to come ask for fresh data.
Instance method; class method.
@synthesize; write our own getter and/or setter.
19. How to do enumeration with NSArray - NSDictionary - etc?
20. What is the base class for most objects in the iOS SDK?
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
Center of the frame - which is in the superview's coordinate system
zero/nil
NSObject
21. ________ is the .h file and __________ is the .m file.
UIViewController.
Interface; Implementation
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.
[Object isMemberOfClass:[Classname class]]
22. What is an example of a reason to write a getter?
id; an object pointer
Lazy instantiation.
NSLog; %@; %d and other formatters
In the getter! This is called lazy instantiation.
23. A _______ is how a view notifies the controller of something - for example - a button press.
Action
[Object isMemberOfClass:[Classname class]]
iOS; when the view is loaded.
NSArray; no - it's immutable.
24. What is the center property of a UIView?
25. Instead of 'include' statements - in Objective-C we use _______ which does ________
My rectangle in my superview's coordinate space
Yes. As much as it wants.
Import / handle multiple inclusion.
Strongly.
26. Talk about NSString
create a model
Yes. The controller knows everything about the model.
Can handle any language because it uses Unicode.
MVC - for model-view-controller
27. Where do I initialize properties?
(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.
On left side - is calling the setter - and on the right side - is calling the getter.
Action
In the getter! This is called lazy instantiation.
28. How to tell whether an object implements a particular method? (A line of code)
[Class respondsToSelector:@selector(aMethod)]
Call setNeedsDisplay:
Strong. Object memory is freed at the end of the routine.
The runtime system asks the object what its class is.
29. If I need to convert a number to an object - use __________
NSUserDefaults - which stores a property list.
NSNumber. For example numberWithDouble: and doubleValue:
NSObject
No. Use NSMutableArray - which is a subclass of NSArray.
30. What is the frame property of a UIView?
31. What is the word for checking/verifying the type of an object?
32. Objects in an array: are the pointed to strongly or weakly?
self.view
Strongly.
NO is zero; YES is anything else.
Dash - Plus sign.
33. What does the controller do?
(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.
Controls how the model is presented onscreen.
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
[Object isMemberOfClass:[Classname class]]
34. A property is just the combination of _______.
Strong. Object memory is freed at the end of the routine.
NSLog; %@; %d and other formatters
One; zero to many
Getter and setter methods.
35. What is a reason to write our own setter?
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
Cocoa Touch - Media - Core Services - Core OS
Argument validation.
for...in; don't change things inside the loop.
36. What does a view (UIView) represent?
The runtime system asks the object what its class is.
Never!
A rectangular area
self.view
37. What about public/private in Objective-C?
38. Does a view 'own' the data it displays?
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.
No - it gets the data from the controller.
[Object isMemberOfClass:[Classname class]]
Can handle any language because it uses Unicode.
39. When happens when you send a message to nil?
Nothing happens - and nil is returned.
NSLog; %@; %d and other formatters
To zero; so pointers are nil.
Yes. The controller knows everything about the model.
40. What about the view talking to the controller?
41. What is the name of a property in the controller that it uses to talk to views?
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.
Action
NSArray; no - it's immutable.
42. All classes should have a __________________ to be called by subclasses.
Designated initializer.
line up the colons!
No...but it has 'a way' to notify the controller to come ask for fresh data.
At runtime.
43. What is static typing? Why is it good?
44. How to see all actions - outlets - incoming/outgoing segues on a view?
Right-click on view - or even a subview like a button.
The document; possibly a database.
Cocoa Touch - Media - Core Services - Core OS
A rectangular area
45. What do I use for an unordered collection - e.g. test for membership? And is it mutable?
46. A _______ goes from the Controller to the View. A ________ goes from the view to the controller.
NSData
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];
Yes. The controller knows everything about the model.
Outlet; Action
47. The view is...
48. The decision on what method to call is made when?
iOS; when the view is loaded.
At runtime.
Yes. The controller knows everything about the model.
Cocoa Touch - Media - Core Services - Core OS
49. Instance methods start with a ______ and class methods start with a ______.
An outlet.
for...in; don't change things inside the loop.
Override drawRect:
Dash - Plus sign.
50. How to instantiate an object?
[Object isMemberOfClass:[Classname class]]
create a model
the controller's minions. Gets things to the screen.
1.) Ask another object to do it - e.g. with mutableCopy. 2.) Call a class method - 3.) [[Classname alloc] init];