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