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. All classes should have a __________________ to be called by subclasses.
Other MVC trios.
Designated initializer.
Dash - Plus sign.
Right-click on view - or even a subview like a button.
2. What is the makeup of a CGPoint?
NSNumber. For example numberWithDouble: and doubleValue:
Two CGFloats for x and y
Properties; instance variables
NSDictionary; no - it's immutable.
3. Can the controller talking to the view?
The document; possibly a database.
Two CGFloats for x and y
Yes. As much as it wants.
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
4. Calling a method on id works just fine because....?
My rectangle in my superview's coordinate space
Outlet; Action
The runtime system asks the object what its class is.
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.
5. Some controllers have ____________ as their views.
Other MVC trios.
'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.
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
6. Instead of 'include' statements - in Objective-C we use _______ which does ________
self
[Object isMemberOfClass:[Classname class]]
Two floats - for width and height
Import / handle multiple inclusion.
7. What do I use for an ordered collection of objects? And is it mutable?
8. The setters for outlets are called by _______ at this point ______________.
No...but it has 'a way' to notify the controller to come ask for fresh data.
NO is zero; YES is anything else.
iOS; when the view is loaded.
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.
9. ________ is the .h file and __________ is the .m file.
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.'
[Object isKindOfClass:[Classname class]]
Interface; Implementation
10. What is the makeup of a CGSize?
[Object isKindOfClass:[Classname class]]
NSSet; no - it's immutable
Two floats - for width and height
Properties; instance variables
11. Are local pointers to objects strong or weak? So what happens at the end of the routine?
NSArray; no - it's immutable.
Strong. Object memory is freed at the end of the routine.
@synthesize; write our own getter and/or setter.
internal origin and size. Use this inside a view
12. Classes cannot have _________ or ___________.
Properties; instance variables
Two floats - for width and height
Interface; Implementation
Two CGFloats for x and y
13. What is the bounds property of a UIView?
internal origin and size. Use this inside a view
id
constant NSString
'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.'
14. What do I use for an unordered collection - e.g. test for membership? And is it mutable?
15. Is it always bad to send messages to id?
16. What do I use for a bag of bits?
NSData
Introspection - with the class method 'class'
NSLog; %@; %d and other formatters
Cocoa Touch - Media - Core Services - Core OS
17. The basic steps in custom drawing.
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
1) Create a context 2) Create paths 3) Set colors - fonts - widths 4) Stroke or fill the above-created paths.
self
Getter and setter methods.
18. Remember that it's cool to...
A CGPoint and and a CGSize
Two CGFloats for x and y
line up the colons!
NO is zero; YES is anything else.
19. If a method starts with a dash - it's a ___________. If it starts with a plus sign - it's a ______________.
self
Instance method; class method.
Getter and setter methods.
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.
20. How are local variables initialized in iOS 5?
The runtime system asks the object what its class is.
To zero; so pointers are nil.
An outlet.
Points - to achieve device-independence
21. How to do enumeration with NSArray - NSDictionary - etc?
22. What does 'strong' mean?
23. How to add subviews in code? How to remove them?
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.
addSubview; removeFromSubview
Never!
24. How many superviews does a view have? How many subviews?
One; zero to many
[Object isKindOfClass:[Classname class]]
NSLog; %@; %d and other formatters
Instance variable (ivar) or 'backing variable'
25. What does the controller do?
Getter and setter methods.
Wrap it in NSValue. And remember that NSValue immutable.
Controls how the model is presented onscreen.
NSUserDefaults - which stores a property list.
26. Use ______ to send debugging messages to the console. Use _____ for any object - which should return an string. Can also use ______.
the controller's minions. Gets things to the screen.
A collection of collections in graph form. Can include NSArray - NSDictionary - NSNumber - NSString - NSData - and NSData.
Cocoa Touch - Media - Core Services - Core OS
NSLog; %@; %d and other formatters
27. Is NSArray mutable?
option-click; option-double-click
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.
No. Use NSMutableArray - which is a subclass of NSArray.
Import / handle multiple inclusion.
28. Dot notation does what?
internal origin and size. Use this inside a view
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
Getter and setter methods.
On left side - is calling the setter - and on the right side - is calling the getter.
29. A _______ is how a view notifies the controller of something - for example - a button press.
NSData
My rectangle in my superview's coordinate space
Sort of - in ways that it doesn't need to know much about the controller. For example: delegation.
Action
30. What about public/private in Objective-C?
31. In synthesize: @synthesize foo = _foo; The __foo_ is the ____________ or also known as the ___________________.
32. The decision on what method to call is made when?
At runtime.
Outlet; Action
Nothing happens - and nil is returned.
To zero; so pointers are nil.
33. How to see all actions - outlets - incoming/outgoing segues on a view?
Right-click on view - or even a subview like a button.
Override drawRect:
for...in; don't change things inside the loop.
A CGPoint and and a CGSize
34. How to tell whether an object implements a particular method? (A line of code)
internal origin and size. Use this inside a view
Can handle any language because it uses Unicode.
[Class respondsToSelector:@selector(aMethod)]
One; zero to many
35. How can I find out the class of any object? Give a line of code.
Class XX = [Object class]
Immutable. But there are many methods that take an NSString and returned a modified one. This is fast and preferable to using NSMutableString.
[[UIView alloc] initWithFrame]
Interface; Implementation
36. What does 'weak' mean?
37. ______ is a pointer
NSSet; no - it's immutable
self
NSObject
A CGPoint and and a CGSize
38. What is the center property of a UIView?
39. What is the iOS term for a library?
Right-click on view - or even a subview like a button.
Yes. The controller knows everything about the model.
[Class respondsToSelector:@selector(aMethod)]
A framework.
40. Show a private interface section.
To zero; so pointers are nil.
@interface JGEmailLoginEmailViewController(){ NSMutableData _receivedData; }@property (weak -nonatomic) JGAppDelegate appDelegate;@property (weak - nonatomic) IBOutlet UITextField *txtfldEmailAddress;@end
Yes. The controller knows everything about the model.
No - it gets the data from the controller.
41. Does a view 'own' the data it displays?
No - it gets the data from the controller.
NSObject
'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.'
Strong. Object memory is freed at the end of the routine.
42. A property is just the combination of _______.
Getter and setter methods.
Action
NSData
A framework.
43. ______ is a pointer to any object.
NSArray; no - it's immutable.
id
Can handle any language because it uses Unicode.
[[UIView alloc] initWithFrame]
44. In a nutshell: how to do custom drawing?
Override drawRect:
Points - to achieve device-independence
Getter and setter methods.
NSData
45. What is the fundamental design pattern of iOS development?
Controls how the model is presented onscreen.
NO is zero; YES is anything else.
MVC - for model-view-controller
NSLog; %@; %d and other formatters
46. What is used in lieu of pixels? And why?
Creating objects - or finding information relative to the class. The name of the class is the first thing in the square brackets.
Points - to achieve device-independence
NSDictionary; no - it's immutable.
Center of the frame - which is in the superview's coordinate system
47. Talk about BOOL variables.
NSLog; %@; %d and other formatters
NO is zero; YES is anything else.
A CGPoint and and a CGSize
Nothing happens - and nil is returned.
48. All properties are initialized to _____
zero/nil
No - it gets the data from the controller.
UIViewController.
[Object isKindOfClass:[Classname class]]
49. Instance methods start with a ______ and class methods start with a ______.
for...in; don't change things inside the loop.
Import / handle multiple inclusion.
Dash - Plus sign.
Points - to achieve device-independence
50. What about the view talking to the controller?